This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

S130/SDK12.1 BLE bootloader related

Hello,

I'm making BLE bootloader except other BLE functions. I'm using s130 / sdk 12.1 / nrf51822xxAA environment. Sure I have some problem.

What I have done :

Application

  • I merged DFU function with my application using nRF5_SDK_12.1.0_0d23e2a\examples
    ble_peripheral\experimental_ble_app_buttonless_dfu
  • Set IROM1 : 0x1B000 / 0x1FC00, IRAM1 : 0x20001FE8. I checked this(nordic template) works in nrf toolbox.

Bootloader

  • I used nRF5_SDK_12.1.0_0d23e2a\examples\dfu\bootloader_secure.
  • Set IROM1 : 0x3AC00 / 0x5000, IRAM1 : 0x20002C00 / ??

My questions are :

  1. How should I allocate IRAM1 in application/bootloader? If I download softdevice/applicaion/bootloader, device name-DfuTarg is checked. It seems that the bootloader does Dfu function.
  2. How can I DFU new image using my application(already dfu merged)?
  3. Would you let me know If there is the information related with this? I didn't find out the exact information.

Thanks.

  • Hi Air,

    1. Set the bootloader IRAM1 section to be identical to that of the application.
    2. If you're using the buttonless example then you have to write 0x01 to the DFU Control Point characteristic in order to put the device in bootloader mode, see this page for more information.
    3. If you're looking for information on the Secure bootloader then I suggest that you take a look at this page on our Infocenter.

    Best regards

    Bjørn

    1. Do you think it’s possible to use S130(SDK 12.x) bootloader (in SDK 12.x) in nRF51822(16KB ram)? Sure, I don't know the exact ram use in my application. But I think the use is under 8KB.
    2. If you're using the buttonless example then you have to write 0x01 to the DFU Control Point characteristic in order to put the device in bootloader mode. -> I understand. But how can I do this? I don’t know. My application enters into buttonless Dfu main function after special key input and soft reset. I don't use any Ble function before entering into buttonless Dfu main function.
  • Additionally, my code is like below. startDfu() is the same as buttoness example main().

    int main(void)

    {

    uint32_t err_code;
    
    UART_TX_HIGH;
    lfclk_config();								// clock init
    nrf_delay_ms(5);
    
    twi_master_init();							// eeprom init
    TWI_400K;										// twi frequency
    
    // dfu check
    if(checkDfu())
    	goto DFU;
    

    . . .

    while (1)
    {
      . . .
    }
    

    DFU:

    startDfu();
    

    }

  • For above problem I tried to write value - 1 to address - 0x3FC00 using nrfjprog --memwr 0x3FC00 --val 1. But I got a error message - ERROR : The area to write is not erased.

  • Q1: Yes, that should be possible. Just keep in mind that the minimum RAM required by the S130 SoftDevice is 0x13C8 bytes, so you're left with 0x2C38 bytes for the application AND the call stack. Q2: If you're using a key input to put the device in bootloader mode, then you can disregards my previous answer. Were you asking how you should create a firmware packet with nrfutil? I see that you have posted a new question regarding this. If this is the case then I suggest that you mark this question as answered by clicking the checkmark in the circle to the left of my answer.

Related