nRF52832 DK compile and link errors

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
knowic
Posts: 5
Joined: Thu Aug 15, 2019 7:49 am

nRF52832 DK compile and link errors

Post by knowic » Thu Aug 15, 2019 8:02 am

Hello, sir:

I have download the latest micropython ports, and compile target as such defined:
make BOARD=pca10040 SD=s132

but get link error as such following, it looks like the variable is not defined well.
Can anyone give some hints about how to fix this issue, thanks!

Best regards!
Jason

user@instant-contiki:~/micro/micropython/ports/nrf$ make BOARD=pca10040 SD=s132
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
GEN build-pca10040-s132/genhdr/qstrdefs.collected.h
QSTR not updated
LINK build-pca10040-s132/firmware.elf
boards/memory.ld:22: nonconstant expression for length
collect2: error: ld returned 1 exit status
make: *** [build-pca10040-s132/firmware.elf] Error 1

memory.ld issues lines:
/* Specify the memory areas */
MEMORY
{
FLASH_TEXT (rx) : ORIGIN = _app_start, LENGTH = _app_size /* app */
RAM (xrw) : ORIGIN = _app_ram_start, LENGTH = _app_ram_size
}

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: nRF52832 DK compile and link errors

Post by jimmo » Thu Aug 15, 2019 8:47 am

This exact build works for me.

Can you check which version of arm-none-eabi-gcc you have?

Code: Select all

arm-none-eabi-gcc --version

knowic
Posts: 5
Joined: Thu Aug 15, 2019 7:49 am

Re: nRF52832 DK compile and link errors

Post by knowic » Thu Aug 15, 2019 9:34 am

Thanks for your quick reply, the version is :

user@instant-contiki:~/micro/micropython/ports/nrf/boards$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 224288]
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: nRF52832 DK compile and link errors

Post by jimmo » Thu Aug 15, 2019 10:03 am

knowic wrote:
Thu Aug 15, 2019 9:34 am
4.9.3 20150529
I'd guess it's probably related to that.

The latest is 9.2. I'd recommend using 8.3 for now.

knowic
Posts: 5
Joined: Thu Aug 15, 2019 7:49 am

Re: nRF52832 DK compile and link errors

Post by knowic » Thu Aug 15, 2019 12:00 pm

Thanks for your information.
What about your linux system platform? 32Bit or 64Bit, I try to find the 32Bit GNU Arm Embedded Toolchain for my Vmware Linux platform,
but find nothing. Could you share me the source? Thanks again.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: nRF52832 DK compile and link errors

Post by jimmo » Thu Aug 15, 2019 12:57 pm

I'm just using my distro's version (Arch Linux, 64bit). What distro are you using? (I'm not sure what you mean by "vmware linux" sorry)

You can download arm-none-eabi-gcc directly at https://developer.arm.com/tools-and-sof ... /downloads but it is much easier to use the distro version.

knowic
Posts: 5
Joined: Thu Aug 15, 2019 7:49 am

Re: nRF52832 DK compile and link errors

Post by knowic » Fri Aug 16, 2019 4:37 pm

Hello, sir.

I have get latest Ubuntu version and compile the firmware.hex and download the hex with JLINK, all run smoothly,
but I get nothing with UART terminal like Putty, Is there something I have missing?

thanks.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: nRF52832 DK compile and link errors

Post by jimmo » Sat Aug 17, 2019 5:27 am

I'm not very familiar with the NRF boards, but some things to check:
- Are you definitely using the right COM port in Putty.
- Have you set the baud rate to 115200 (that's configured in ports/nrf/main.c)
- Did you press enter once it connected to get the prompt?

More info about how the USB->UART works for these boards : https://infocenter.nordicsemi.com/index ... f_mcu.html

Do you have any sort of debugging tools (i.e. oscilloscope or signal analyser, or even a separate USB/UART adaptor?) that you can check the TX/RX lines on the board?

Otherwise I'd suggest maybe modifying main.c to flash one of the LEDs or something and at least verify that MicroPython is starting up. Or use the JLINK to attach a debugger.

amzounslide95
Posts: 1
Joined: Sat Sep 14, 2019 7:08 pm

Re: nRF52832 DK compile and link errors

Post by amzounslide95 » Sat Sep 14, 2019 7:11 pm

That is the proper configuration: we are using it here every day.
Just to clarify:
nRF VDD -> VTG -> BOARD VDD
GND DETECT -> NRF52 DK GND -> BOARD GND
That is assuming you want to power your board with the NRF52DK.

c45713
Posts: 51
Joined: Fri Dec 09, 2016 7:09 pm

Re: nRF52832 DK compile and link errors

Post by c45713 » Mon Sep 16, 2019 6:19 am

Did you also flash the SoftDevice? Else it will not be able to hit the application firmware, it needs the SoftDevice to jump to the application in case of SD=s132.

Code: Select all

make BOARD=pca10040 SD=s132 sd

Post Reply