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

Logs from the QSPI application using XiP

Hi,

I want to run QSPI application example on my nRF52840DK (PCA10056) board with logs seen via UART. I successfully uploaded QSPI bootloader example and Blinky SysTick example to my board. It's running ok and I can see the logs from QSPI bootloader on the UART. 

But when I add logs to the Blinky SysTick example then the QSPI bootloader works fine (I can see the logs from QSPI bootloader), but the program from external flash crashes on line 613 in nrf_fprintf_fmt() function from nrf_fprintf_format.c file, after NRF_LOG_FLUSH() call and I can't see the logs. 

The code snippet from modified Blinky SysTick example that I use:

/**@brief   Initialize logging. */
static void log_init(void)
{
    ret_code_t rc = NRF_LOG_INIT(NULL);
    APP_ERROR_CHECK(rc);
    NRF_LOG_DEFAULT_BACKENDS_INIT();
}

int main(void)
{
    ret_code_t rc;

    /* Configure LED-pins as outputs. */
    bsp_board_init(BSP_INIT_LEDS);

    /* Init systick driver */
    nrf_drv_systick_init();

    log_init();

    while (true)
    {
        for (int i = 2; i < 4; i++)
        {
            bsp_board_led_invert(i);
            nrf_drv_systick_delay_ms(500);
            NRF_LOG_RAW_INFO("test");
            NRF_LOG_FLUSH();
        }
    }
}

I've also modified some parameters in sdk_config in comparison to sdk_config.h from the example:

#define NRF_LOG_BACKEND_RTT_ENABLED 0 
#define NRF_LOG_BACKEND_UART_ENABLED 1 
#define NRF_LOG_DEFERRED 0 
#define NRF_LOG_ALLOW_OVERFLOW 0 
#define SEGGER_RTT_CONFIG_DEFAULT_MODE 2 
#define NRFX_SYSTICK_ENABLED 1

I'm using CMake in my project. 

Parents
  • I want to use an external flash for the OTA update, we want to have 2 programs in the external flash in case we want to restore software to the previous version for some reason. Bootloader shall select which program it needs to start. The plan is that bootloader will read which program it needs to start from FDS(flash data storage) or any other permanent storage.  I develop the firmware for a device that is located in a hard to access location and having a backup procedure for OTA update is a required feature. I looked at the documentation of nRF52840 and I think that the solution should work.  I used GDB and Qt Creator to debug the project.

Reply
  • I want to use an external flash for the OTA update, we want to have 2 programs in the external flash in case we want to restore software to the previous version for some reason. Bootloader shall select which program it needs to start. The plan is that bootloader will read which program it needs to start from FDS(flash data storage) or any other permanent storage.  I develop the firmware for a device that is located in a hard to access location and having a backup procedure for OTA update is a required feature. I looked at the documentation of nRF52840 and I think that the solution should work.  I used GDB and Qt Creator to debug the project.

Children
No Data
Related