You are here

Compiling code for NRF52

4 posts / 0 new
Last post
shaman
Offline
Last seen: 7 months 2 weeks ago
VESC Free
Joined: 2018-12-09 15:59
Posts: 60
Compiling code for NRF52

I've been trying to change the RX/TX pin assignments for the NRF52 code from Ben's Github repo. Unfortunately I think I'm doing something wrong because the code doesn't work after I compile the code and flash it to the NRF52832  module. I have installed the ARM and  NRF52 SDK dependencies and also changed the IS_52832 variable in the makefile to 1.

Ben's precompiled bin files for the NRF52 work. This means my flashing method works. Something is wrong with how I am altering and/or compiling the code. I have been trying the same approach as I do with the controller firmware creation by using Chibi OS/ Eclipse as the IDE. 

Does anybody know what I could be doing wrong or have suggestions on how to do it properly?

shaman
Offline
Last seen: 7 months 2 weeks ago
VESC Free
Joined: 2018-12-09 15:59
Posts: 60

Found out about having to merge the Soft Device hex file and the application hex file into one file for flashing. Can be achieved with the Nordic Mergehex command line application. 

Still having trouble even after merging the hex files but I'm still trying to figure it out. 

shaman
Offline
Last seen: 7 months 2 weeks ago
VESC Free
Joined: 2018-12-09 15:59
Posts: 60

Was merging some files out of the wrong directory. Merging the proper soft device hex and proper application hex did the trick. See summary of findings below.

1. Can bring in NRF52 code from the GitHub repo into chibi studio/eclipse. Have to install ARM and Nordic SDK dependencies for code to compile/build

2. Download and use the Nordic command line tool, mergehex, to combine the soft device hex and the built application hex.

3. Flash the merged hex to the nrf module

 

thats not a complete summary but the best I can do for now while using a mobile device to post. I'll edit this later to have more details

joomyll
Offline
Last seen: 22 hours 26 min ago
VESC Free
Joined: 2022-11-16 20:46
Posts: 1

I'm having some troubles compiling the code for nrf52832. Is there pre compiled files somewhere that I can just flash?

edit. modify following line on storage.h

extern config_data m_config;

c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa/storage.c.o:C:\Users\Joona\Downloads\nrf52_vesc-master/storage.h:26: multiple definition of `m_config'; _build/nrf52840_xxaa/main.c.o:C:\Users\Joona\Downloads\nrf52_vesc-master/storage.h:26: first defined here
collect2.exe: error: ld returned 1 exit status