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 will add more depth to my problem.

    I need to run firmware from external flash and store a new firmware for OTA there with the ability to switch between 2 firmware runtimes. I use the newest SDK17 version downloaded from your website a few days ago.

    What I did to this point:

    • Run example program on internal flash and was able to observe the logs on UART(both for JLink USB output and UART PIN6)
    • Run QSPI example bootloader on internal flash and Blinky SysTick example on the external flash. It worked and I saw LEDs blink. (I could see bootloader logs on UART)
    • Modify blinky example to log something to UART (problem started here)

    So the problem is:

    • UART logger prints only bootloader logs correctly
    • Application from external flash prints random sign when the program is flashed to the begging of the external flash 
    • Application from external flash crashes when the program is flashed to the other part of the external flash. Application crashes on  line 613 in nrf_fprintf_fmt(). Because of some empty string format. (p_fmt = "")

    I use CMake to build the program and nrfjprog to flash the device

    I'm happy to provide all the necessary information. We can set up a  meeting where I can show you the problem if it is required.  

    I attach my programs:QSPI_bootloader.zipBlinkySysTick.zip

Reply
  • I will add more depth to my problem.

    I need to run firmware from external flash and store a new firmware for OTA there with the ability to switch between 2 firmware runtimes. I use the newest SDK17 version downloaded from your website a few days ago.

    What I did to this point:

    • Run example program on internal flash and was able to observe the logs on UART(both for JLink USB output and UART PIN6)
    • Run QSPI example bootloader on internal flash and Blinky SysTick example on the external flash. It worked and I saw LEDs blink. (I could see bootloader logs on UART)
    • Modify blinky example to log something to UART (problem started here)

    So the problem is:

    • UART logger prints only bootloader logs correctly
    • Application from external flash prints random sign when the program is flashed to the begging of the external flash 
    • Application from external flash crashes when the program is flashed to the other part of the external flash. Application crashes on  line 613 in nrf_fprintf_fmt(). Because of some empty string format. (p_fmt = "")

    I use CMake to build the program and nrfjprog to flash the device

    I'm happy to provide all the necessary information. We can set up a  meeting where I can show you the problem if it is required.  

    I attach my programs:QSPI_bootloader.zipBlinkySysTick.zip

Children
No Data
Related