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

Error in Linker script setup for SD110 v8, SDK v8.1

Hello,

Some questions regarding the linker script for the 8.1 SDK for SD110.

I was able to get an environment set up with ARM GCC, Make, etc. and compiled my program using the V7 SDK (for which it was written). I was able to resolve all of the issues in migrating to the 8.1 SDK and the program now compiles. However...

  1. What was previously under ./components/toolchain/gcc/*.ld had different versions for xxac, s110, s120, etc. These were removed. Is it now expected to copy "nrf51_xxac.ld" into the project directory and customize that?

  2. After compiling, and flashing, with the SD v8 already flashed, the eponymous error in writing to region 0 occurs. Great! I've seen that, and know how to resolve it -

    APP_CODE_BASE is 0x00018000 Total FLASH for QFAC is 256kB. 1kB = 1024 Bytes - that's 0x40000 total. So, the application ORIGIN is 0x00018000 and the length is 0x40000 - 0x00018000 - or 0x28000

    Flash line in linker script - FLASH (rx) : ORIGIN = 0x00018000, LENGTH = 0x28000

    APP_RAM_BASE is 0x20002000 Total RAM for QFAC is 32kB. That's 0x8000 total. RAM base is 0x20000000, so the SD uses 0x2000 of the 0x8000. That leaves 0x6000 for our application RAM length.

    RAM line in linker script - RAM (rwx) : ORIGIN = 0x20002000, LENGTH = 0x6000

After the above settings, I still see the region 0 error. Why is this? The linker script matches exactly the values I would have put into Keil, and the process I used was the same as described in the SD specification (and which worked perfectly before, when I needed to update the addresses because there were many conflicting numbers floating around on the forums).

Are SD v8 and SDK v8.0 compatible? Am I missing something in the region calculations above?

Thanks, -Alex

Parents
  • Hi Alex,

    Yes, the SD v8 and SDK v8.0 are compatible . The memory map settings are FLASH (rx) : ORIGIN = 0x00018000, LENGTH = 0x28000 /* 96 kB is taken by S110, 160 kB available for application. */ SRAM (rwx) : ORIGIN = 0x20002000, LENGTH = 0x02000 / 8 kB, 8 kB is taken by S110. */ You need to change the Length of RAM to 0x2000

    I had not updated the comment, it was referring to the previous version of the SD. From your screenshot, it looks like that you are trying to erase the memory while programming the hex file. But you should not do that. After programming the soft device, you need to just set the speed, enable writing and write to the address 0x00018000

    device nrf51822 speed 1000 w4 4001e504 1 loadbin $(BUILD)/$(PROJECT).bin 0x00018000 r g exit

    Hope it resolves your issue.

    Anshul

  • Hi,

    This also doesn't work. See output here - paste.ofcode.org/SskDupXwQCBCSaeJEKPrbZ

    Also, how did you get to the 0x2000 value for the RAM length? I am reading nRF51822 S110 SoftDevice Specification - v3.1, which was updated to cover the S110 v8 soft device. Page 34, it states that the RAM for the SD (MBR) starts at 0x20000000 and ends at APP_RAM_BASE - which is 0x20002000. The rest belongs to the application, AFAIK - so, up until 0x20000000 + 0x8000. This length is from 0x2000 to 0x8000, or 0x6000. Why would it be only 0x2000 in your example?

    Also, while the numbers are correct, 88kB for SD v8 sounds incorrect. If I flash it through nRFgo Studio, it says 96kB - which is 0x18000 start address. Was that just an outdated comment?

    Thanks, -Alex

Reply
  • Hi,

    This also doesn't work. See output here - paste.ofcode.org/SskDupXwQCBCSaeJEKPrbZ

    Also, how did you get to the 0x2000 value for the RAM length? I am reading nRF51822 S110 SoftDevice Specification - v3.1, which was updated to cover the S110 v8 soft device. Page 34, it states that the RAM for the SD (MBR) starts at 0x20000000 and ends at APP_RAM_BASE - which is 0x20002000. The rest belongs to the application, AFAIK - so, up until 0x20000000 + 0x8000. This length is from 0x2000 to 0x8000, or 0x6000. Why would it be only 0x2000 in your example?

    Also, while the numbers are correct, 88kB for SD v8 sounds incorrect. If I flash it through nRFgo Studio, it says 96kB - which is 0x18000 start address. Was that just an outdated comment?

    Thanks, -Alex

Children
No Data
Related