NRF522832 FreeRTOS can't start.

Hi everyone:

I developed an application based on freertos, but when I download it, I found it can not start, but when I use the RTT to connect my device, It worked.

The commend is

nrfutil settings generate --family NRF52 --application app.hex --application-version 0 --bootloader-version 0 --bl-settings-version 2 settings.hex
nrfjprog --eraseall -f NRF52
nrfjprog --program mbr_nrf52_2.4.1_mbr.hex --verify -f NRF52
nrfjprog --program nrf52832_xxaa_mbr.hex --verify -f NRF52
nrfjprog --program app.hex --verify -f NRF52
nrfjprog --program settings.hex --verify -f NRF52
nrfjprog --reset -f NRF52

SDK is 17.1.0.

Best regards,

Lurn.

Parents Reply
  • OK, when I  delete this code nrf_drv_clock_lfclk_request(NULL);  My device started working normally.

    And when set the RX pin pullup, I no longer get gibberish data.

    So,I think it works fine weather enable the UART or not.

    but when I program MBR and application, the FreeRTOS didn't start scheduler.

    1. I only program application (address start 0x00), everthing looks ok, I can receive the data I send and rtt will show logs.

    2. I program MBR and application (address start 0x1000), logs looks ok before the code running to vTaskStartScheduler(), and then there was nothing, I can't receive anything, even if I keep sending data.

    BR,

    Lurn

Children
  • Lurn_Z said:
    can't receive anything, even if I keep sending data.

    What data? How do you send it? UART? BLE? ESB?

    Does vTaskStartScheduler() return?

    Do any of your tasks actually start? Have you tried debugging? Does it hardfault (stop around 0xA60 in the callstack), or does it keep running, just with no log output?

  • Do any of your tasks actually start?

    Nope, the tasks not stat, and the vTaskStartScheduler() doesn't return.the debug session is running and not arrived the breakpoint.

    What data? How do you send it? UART? BLE? ESB?

    I use UART to send it, data is like abc...or something, just for test.

  • Lurn_Z said:
    can't receive anything, even if I keep sending data.

    So that is because your threads aren't started, right?

    It may be a bit too late, but do you really need FreeRTOS? 

    I don't know why it doesn't work from your screenshot. Can you please send the application?

    And you did program the MBR, right?

    Oh, did you change your clock configurations in your application to use the internal RC Oscillator instead of the external LFXTAL? Because your custom board didn't have an external LFXTAL, right?

    BR,

    Edvin

  • It may be a bit too late, but do you really need FreeRTOS? 

    yes, I need FreeRTOS to scheduler my different processes.

    And you did program the MBR, right?

    yes, I program the MBR, and the problem arose after that, when I only use FreeRTOS (address start from 0x00), my device looks fine.

    Can you please send the application?

    I can't send you my all application, but I can try to reduce something.

    Oh, did you change your clock configurations in your application to use the internal RC Oscillator instead of the external LFXTAL? Because your custom board didn't have an external LFXTAL, right?

    before vTaskStartScheduler(); I used this.

    {
        nrf_drv_clock_init();
        
        NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
        NRF_CLOCK->TASKS_HFCLKSTART = 1;
        
        while(NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);
    }

    BR,

    Lurn

  • Lurn_Z said:
    I can't send you my all application, but I can try to reduce something.

    Ok, can you please send me a strip down version, or at least an application that replicates the issue that you are seeing?  You can use one of the examples in the SDK as a starting point. 

    Also, search your application's sdk_config.h for "LF_SRC". Are they all set to 1? If so, they should be set to 0. And also, all occurences of:

    ...RC_CTIV should be set to 16
    ...RC_TEMP_CTIV should be set to 2
    ...CLOCK_LF_ACCURACY should be set to 1

Related