This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Porting code from Keil to SES 3.40 on NRF51822 Device with SDK12_3 Vector catch error before main

I am trying to port Keil code to SES 3.40 with NRF51822 Device and SDKV12_3, I am currently using the ble_app_uart example. I followed this blog post  https://devzone.nordicsemi.com/b/blog/posts/segger-embedded-studio-a-cross-platform-ide and finally got to a place where I can build , program and generate hex files. When I went for debug the code I get the message stopped by vector catch and my device never advertises , also does not go into main and always gets caught at 0x000006B0 (flash memory address) . I went through different forms I see that this issue more related to Flash size , sram size ,flash_placemet.xml and thumb_crt0.s file. 

Debug steps: 

1.Check If the hex file is generated okay : I read the hex file using J-Flash and it started at the right address.

2. Check softdevice and application are actually being programmed: I verified the hex file is completely written, with the help of a  merged hex file and made sure that contents are matched.

3.Check if the FLASH, SRAM address are correct , I am currently using what Kiel and arm gcc had used FLASH_START=0x1B000;SRAM_START=0x20001FE8

4.Made sure flash_placement.xml , thumb_crt0.s file is as mentioned. Went through the tutorial and comments did not find anything that works

Can you help me out to fix the issue and know what is happening?

Update: I noticed that the entry point was reset_handler and had a breakpoint there and stepped into the program , noticed that after __sram_end_segment__ it was going to 0x6B0 and alsoI noticed that __sram_end_segment__ = 0x8000 but my chip is 16KB , I noticed that this is true by looking at the build size and %.

I realized placing FLASH_SIZE or SRAM_SIZE in flash placement macros has no effect , as they are not used in falsh_placement.xml .

I added a new memory_segment.xml and added it to the ses through the builder options ,I was able to build them  see that  SRAM was of correct size. Then I ran the code and event into the same address 0x6B0 but through the main. The picture should tell you how I go there. I have not done much debugging for this issue , I just want to keep you updated with whats going on my side and also can you verify if  my memory_segment file has anything to do with the current vector catch . I also made minor changes to many parts of the settings , I will port a new project and see how that turns out.

Parents Reply Children
No Data
Related