← index #5162PR #6246
Related · medium · value 1.761
QUERY · ISSUE

[nRF port] Unable to activate MICROPY_PY_SYS_STDFILES in mpconfigport.h

openby sebi5361opened 2019-09-30updated 2021-06-08
port-nrf

I was unable to turn on some of the features in mpconfigport.h, such as MICROPY_PY_SYS_STDFILES, MICROPY_PY_MATH_SPECIAL_FUNCTIONS, MICROPY_PY_IO_FILEIO and MICROPY_PY_MACHINE_SPI, as make would fail with those features on (nRF port).

Below are the error messages:

  • Error when #define MICROPY_PY_SYS_STDFILES (1):
LINK build-pca10040-s132/firmware.elf
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/ccCsRh6Z.ltrans2.ltrans.o: in function `mp_sys_print_exception.lto_priv.992':
/mnt/c/Users/sebi/Documents/TINKERING/MicroPython/FORKS/micropython/ports/nrf/../../py/modsys.c:110: undefined reference to `mp_sys_stdout_obj'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/ccCsRh6Z.ltrans2.ltrans.o:(.rodata+0xb4): undefined reference to `mp_sys_stdout_obj'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/ccCsRh6Z.ltrans2.ltrans.o:(.rodata+0x1c8): undefined reference to `mp_sys_stdout_obj'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/ccCsRh6Z.ltrans2.ltrans.o:(.rodata+0x246c): undefined reference to `mp_sys_stdin_obj'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/ccCsRh6Z.ltrans2.ltrans.o:(.rodata+0x2474): undefined reference to `mp_sys_stdout_obj'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/ccCsRh6Z.ltrans2.ltrans.o:(.rodata+0x247c): undefined reference to `mp_sys_stderr_obj'
collect2: error: ld returned 1 exit status
make: *** [Makefile:344: build-pca10040-s132/firmware.elf] Error 1
  • Error when #define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (1)
CC build-pca10040-s132/pins_gen.c
LINK build-pca10040-s132/firmware.elf
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/cchaRFoM.ltrans2.ltrans.o: in function `mp_math_lgamma.lto_priv.1007':
/mnt/c/Users/sebi/Documents/TINKERING/MicroPython/FORKS/micropython/ports/nrf/../../py/modmath.c:170: undefined reference to `lgammaf'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/cchaRFoM.ltrans2.ltrans.o: in function `mp_math_gamma.lto_priv.1006':
/mnt/c/Users/sebi/Documents/TINKERING/MicroPython/FORKS/micropython/ports/nrf/../../py/modmath.c:168: undefined reference to `tgammaf'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/cchaRFoM.ltrans2.ltrans.o: in function `mp_math_erfc.lto_priv.1005':
/mnt/c/Users/sebi/Documents/TINKERING/MicroPython/FORKS/micropython/ports/nrf/../../py/modmath.c:166: undefined reference to `erfcf'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/cchaRFoM.ltrans2.ltrans.o: in function `mp_math_erf.lto_priv.1004':
/mnt/c/Users/sebi/Documents/TINKERING/MicroPython/FORKS/micropython/ports/nrf/../../py/modmath.c:164: undefined reference to `erff'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/cchaRFoM.ltrans2.ltrans.o: in function `mp_math_atanh.lto_priv.982':
/mnt/c/Users/sebi/Documents/TINKERING/MicroPython/FORKS/micropython/ports/nrf/../../py/modmath.c:120: undefined reference to `atanhf'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/cchaRFoM.ltrans2.ltrans.o: in function `mp_math_asinh.lto_priv.981':
/mnt/c/Users/sebi/Documents/TINKERING/MicroPython/FORKS/micropython/ports/nrf/../../py/modmath.c:118: undefined reference to `asinhf'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/cchaRFoM.ltrans2.ltrans.o: in function `mp_math_acosh.lto_priv.980':
/mnt/c/Users/sebi/Documents/TINKERING/MicroPython/FORKS/micropython/ports/nrf/../../py/modmath.c:116: undefined reference to `acoshf'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/cchaRFoM.ltrans2.ltrans.o: in function `mp_math_log2.lto_priv.975':
/mnt/c/Users/sebi/Documents/TINKERING/MicroPython/FORKS/micropython/ports/nrf/../../py/modmath.c:106: undefined reference to `log2f'
collect2: error: ld returned 1 exit status
make: *** [Makefile:344: build-pca10040-s132/firmware.elf] Error 1
  • Error when #define MICROPY_PY_IO_FILEIO (1)
LINK build-pca10040-s132/firmware.elf
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/ccKalfRU.ltrans2.ltrans.o:(.rodata+0x25fc): undefined reference to `fatfs_type_fileio'
/usr/local/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /tmp/ccKalfRU.ltrans2.ltrans.o:(.rodata+0x2604): undefined reference to `fatfs_type_textio'
collect2: error: ld returned 1 exit status
make: *** [Makefile:344: build-pca10040-s132/firmware.elf] Error 1
  • Error when #define MICROPY_PY_MACHINE_SPI (1):
CC ../../extmod/machine_spi.c
../../extmod/machine_spi.c: In function 'mp_machine_soft_spi_print':
../../extmod/machine_spi.c:175:67: error: expected ')' before 'MP_HAL_PIN_FMT'
     mp_printf(print, "SoftSPI(baudrate=%u, polarity=%u, phase=%u,"
                                                                   ^
                                                                   )
         " sck=" MP_HAL_PIN_FMT ", mosi=" MP_HAL_PIN_FMT ", miso=" MP_HAL_PIN_FMT ")",
                 ~~~~~~~~~~~~~~
../../extmod/machine_spi.c:174:32: error: unused variable 'self' [-Werror=unused-variable]
     mp_machine_soft_spi_obj_t *self = MP_OBJ_TO_PTR(self_in);
                                ^~~~
At top level:
../../extmod/machine_spi.c:146:17: error: 'baudrate_from_delay_half' defined but not used [-Werror=unused-function]
 STATIC uint32_t baudrate_from_delay_half(uint32_t delay_half) {
                 ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [../../py/mkrules.mk:47: build-pca10040-s132/extmod/machine_spi.o] Error 1
CANDIDATE · PULL REQUEST

nrf: Split mpconfigport.h into multiple files.

closedby glennrubopened 2020-07-15updated 2020-07-22
port-nrf

Splitting mpconfigport.h into multiple device specific
files in order to facilitate variations between devices.

Due to the fact that the devices might have variations in
features and also variations in flash size it makes sense
that some devices offers more functionality than others
without being limited by restricted devices.

For example more micropython features can be activated for
nrf52840 with 1MB flash, compared to nrf51 with 256KB.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied