Skip to content

Set Custom Entry Point - nrf52840 #10608

@DBS06

Description

@DBS06

Description

Hi,
I have an Application with Softdevice and a Custom-Mbed-Bootloader (mbed-dev application).
The main taskt of the Custom-Mbed-Bootloader is to update the Main-Application (which works already very well) and to update the Softdevice (which does not work yet).

Current Start-Up Procedure:

  1. Nordic-Bootloader starts
  2. Nordic-Bootloader starts Softdevice
  3. Softdevice starts Custom-Bootloader
  4. Custom-Bootloader checks if there is a FW-Update or a Softdevice-Update with FW.
  5. Custom-Bootloader start Main-Application.

Current Flash Organization:

+-------------------+   End of ROM 0x100000
|                   |
|                   |
|  Firmware Update  |
|  Partition        |
|                   |
+-------------------+
|                   |
|                   |
|    Firmware       |
|    Partition      |
|  (main program)   |
|                   |
+-------------------+
|  Custom           |
|  Bootloader       |
|                   |
+-------------------+
|                   |
|    Softdevice     |
| Nordic-Bootloader |
+-------------------+   Start of ROM 0x0

As mentioned the FW-Update works very well, but when I try to clear the partition of the Softdevice, the erase function in nrf_fstorage_sd.c returns NRF_ERROR_NO_MEM.
I guess the reason why this is not possbiele, is that the Softdevice is already initialized when my Custom-Bootloader starts and when the Softdevice is initialized, it does not allow to overwrite his flash-partition. Or maybe it is possible, but if yes, how? I didn't find anything about it...

Therefore, it would be helpful to set the entry-address for the nrf52840 to the start address of my Custom-Bootloader. The Custom-Bootloader would do his tasks and when he is finished it would start the Softdevice, which starts the Main-Application.
Is this possible? When yes, how?

The Start-Up Procedure would be like this:

  1. Custom-Bootloader starts
  2. Custom-Bootloader checks if there is a FW-Update and a Softdevice-Update
  3. Custom-Bootloader starts Nordic-Bootloader
  4. Nordic-Bootloader starts Softdevice
  5. Softdevice starts Main-Apllication

If it is possible I would organize the Flash like this:

+-------------------+   End of ROM 0x100000
|  Custom           |
|  Bootloader       |
|                   |
+-------------------+   0x0EE000 (for example)
|                   |
|                   |
|  Firmware Update  |
|  Partition        |
|                   |
+-------------------+
|                   |
|                   |
|    Firmware       |
|    Partition      |
|  (main program)   |
|                   |
+-------------------+
|                   |
|    Softdevice     |
| Nordic-Bootloader |
+-------------------+   Start of ROM 0x0

I was already able to build the Custom-Bootloader (mbed-dev application) without Softdevice, but I wasn't able to configure the Custom-Bootloader with an Entry-Address of i.e. 0x0EE000.

The second solution I thought about, would be to set the Custom-Bootloader to address 0x0 and the Softdevice would by placed after the Custom-Bootloader.
Therefore I would organize the Flash like this:

+-------------------+   End of ROM 0x100000
|                   |
|                   |
|  Firmware Update  |
|  Partition        |
|                   |
+-------------------+
|                   |
|                   |
|    Firmware       |
|    Partition      |
|  (main program)   |
|                   |
+-------------------+
|                   |
|    Softdevice     |
| Nordic-Bootloader |
+-------------------+
|  Custom           |
|  Bootloader       |
|                   |
+-------------------+   Start of ROM 0x0

This would be the most preferred solution for me, but I think this is not possible, because the Softdevice with the Nordic-Bootloader is pre-build, which means the entry-addresses for Softdevice with the Nordic-Bootloader are atomic.
If it would be possible, how can I do this?

Issue request type

[X] Question
[ ] Enhancement
[ ] Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions