-
SoftDevice : S110 7.1
-
SDK 7.2
-
Example : dfu\bootloader (using dual bank)
-
Using IAR 7.1
(Before debugging with IAR, I downloaded both the bootloader.hex and s110 7.1 hex with nrfjprog.exe)
- Modified SDK files : bootloader_util_arm.c (copied asm code from SDK 8.1 files since I use ICCARM,
thanks to Vidar Berg for answering my prev question.)
-
Using nRFGo Studio 1.19.0
-
Board : PCA10001 V 2.0.0 (Rev. 2 MCU)
/****************/
First, I used the nrfjprog.exe. The command was
nrfjprog.exe --eraseall --programs s110_nrf51822_7.1.0_softdevice.hex --program bootloader.hex --dfu --verify --reset
After the board being reset, while running the example at debug mode,
the program fell into the HardFault_handler.
What is the problem?
Added : 8, July, 2015 DFU 7.2bootloader.zip Here you go.
I also attached the SDK 7.2 files since I changed bootloader_util_arm.c.
Also you can save time for setting include paths.
Yes, I migrated and made the project manually.
Added : 11, July, 2015 : I changed the linker script (dfu7_2.icf).
Thanks to Vidar Berg's answer, I followed Vidar's setting.
As Aryan said, the code optimization level is changed.
However, if I choose High - Speed (checked "No size constraints"),
the linker showed an error about the size. So I chose "Balanced".
Without HardFault, it went well.
I checked with the iOS App. It was successful.
As well as Android, it was fine.
Before accepting the answer, pardon me for asking,
I want to correct my idea (which could be a serious misconception).
Previously I set the linker script as
// Previously, Linker Script of the bootloader example. My other projects also followed this setting.
.invec start = 0x00016000
ROM = 0x00016000 ~ 0x0003FFFFF
RAM = 0x20002000 ~ 0x20003FFFF
I used this setting all the time when trying other examples as well.
I understood as both the flash memory 0x0 ~ 0x00016000 (or lower) and
the RAM 0x20000000 ~ 0x20002000 (or lower)
was occupied with codes and data of S110 (ver 7.2).
-
Am I thinking it correctly?
-
The memory layout (dual bank) shows that the MBR (Master Boot Record) is at the bottom of the memory.
Does the SoftDevice moves it location from 0 to 0x001000 while initializing the bootloader?
Or when I program the SoftDevice with the nRFgo studio, does the studio
programs the SoftDevice at 0x001000 including the MBR?
- After this, I want to insert my firmware(Application, as specified at the memory layout)
to the board. Then, does my firmware's linker script settings follow the same value?
Or does it use the same value like I did?
// Linker Script of my Project (after downloading the bootloader)
.invec start = 0x0003C000 Or 0x00016000 ?
ROM = 0x0003C000 ~ 0x0003FBFF Or 0x00016000 ~ 0x0003FFFFF Or 0x00016000 ~ 0x0003BFFF ?
RAM = 0x20002C00 ~ 0x20003F7F Or 0x20002000 ~ 0x20003FFFF Or 0x20002000 ~ 0x20003F80?
- At Keil uVision, when setting iRAM and iROM, there is an option selecting "no init".
Is there the same feature in IAR? Or does this has to be done manually?
Added 15, July, 2015 : I added a picture about the RAM.
This is the original setting at the bootloader example (SDK 7.2).
-Regards, Mango922