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

NRF52840 Donlge - JLink Programming

Hi

I have a coupe of dongles working on a project. While validating the board, i notice a strange behavior:

I have the dongles in factory reset (MBR at start, the Bootloader at the end of flash), and i took a backup of this so i can restore dongles anytime.

So what i have now is a blinky program, based on MbedOS. There i modified the linker script so Flash_Start = 0x1000 and Ram_Start=0x20000008 (copied over from the OT-CLI example from the dongle).

So when i now go ahead and program my blinky app (hex) with the NrfConnect-Programmer, it works just fine. Blinky works, or if reset is pressed, i go into DFU bootloader mode.
If i do the same but program the blinky app directly with JFlash from the Segger tools, nothing works.

So i went ahead and read both chips and compared them.

See both files here for a text compare (https://we.tl/t-SqAry7eaAh)

Why is somehow my blinky app (after 0x1000 in flash) looking different? do you guys somewhat do more than just flash a hex file during nrfconnect-programming?
i use this method a lot any other Cortex-M chip with more than 1 binary in its flash storage, i know what im doing. so right now im lost with the nordic chips, which somewhat behalve strangely.

Please help me out here, with a detailed explaination.

thank you

Parents
  • Ok. Here is the hexfile i flashed (https://we.tl/t-VuXnDaqxy8)

    #include "mbed.h"
    
    int main()
    {
        DigitalOut led1(P0_6,  1);
        DigitalOut led2(P0_8,  1);
        DigitalOut led3(P1_9,  1);
        DigitalOut led4(P0_12, 1);
    
        while (true)
        {
            led1.write(0);
            ThisThread::sleep_for(10);
            led1.write(1);
            ThisThread::sleep_for(10);
    
            led2.write(0);
            ThisThread::sleep_for(10);
            led2.write(1);
            ThisThread::sleep_for(10);
    
            led3.write(0);
            ThisThread::sleep_for(10);
            led3.write(1);
            ThisThread::sleep_for(10);
    
            led4.write(0);
            ThisThread::sleep_for(10);
            led4.write(1);
            ThisThread::sleep_for(10);
        }
    }

    #define MBED_APP_START 0x1000
    #define MBED_APP_SIZE 0xDB000
    #define MBED_RAM_START 0x20000008
    #define MBED_RAM_SIZE 0x3FFF8
    #define MBED_BOOT_STACK_SIZE 0x800
    #define MBED_RAM0_START MBED_RAM_START
    #define MBED_RAM0_SIZE  0x100
    
    #define MBED_CRASH_REPORT_RAM_START (MBED_RAM0_START + MBED_RAM0_SIZE)
    #define MBED_CRASH_REPORT_RAM_SIZE  0x100
    
    #define MBED_RAM1_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
    #define MBED_RAM1_SIZE  (MBED_RAM_SIZE - (MBED_RAM0_SIZE + MBED_CRASH_REPORT_RAM_SIZE))
    
    MEMORY
    {
      FLASH (rx)     : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
      RAM_NVIC (rwx) : ORIGIN = MBED_RAM0_START, LENGTH = MBED_RAM0_SIZE
      RAM_CRASH_DATA (rwx) : ORIGIN = MBED_CRASH_REPORT_RAM_START, LENGTH = MBED_CRASH_REPORT_RAM_SIZE
      RAM (rwx)      : ORIGIN = MBED_RAM1_START, LENGTH = MBED_RAM1_SIZE
    }

  • Hi Jorgen

    Is this ticket still in process or do you need more information ?

    Thank you

Reply Children
No Data
Related