0

freertos & logging

zamek gravatar image

asked 2017-08-12 09:20:12 +0100

Hi All,

I would like to use FreeRTOS in my project. I try to play with the examples/ble_peripheral/ble_app_hrs_freertos project.

I have enabled logging with RTT. The program is working well, I can connect with JLinkRTTClient and I have seen log messages. And when I try to logging in a task ble_stack_thread function for example the first line of function:

NRF_LOG_INFO("Task started\r\n");

it goes to HardFault_c_handler with address 0x20002db8. When I comment this log messages it works well.

It seems to be some problem with FreeRTOS and logging.

I changed port_cmsis_systick.c as suggested here: https://devzone.nordicsemi.com/questi...

I use Debian Linux/Eclipse and SDK version is: nRF5_SDK_12.3.0_d7731ad

thnx Zamek

edit retag flag offensive close delete report spam

2 answers

Sort by » oldest newest most voted
0
zamek gravatar image

answered 2017-08-15 17:06:56 +0100

updated 2017-08-15 17:09:50 +0100

Hi Bjorn,

I downloaded the nRF5_SDK_14.0.0_3bcc1f7, but in this example contains only one task, which is the logging task:( The ble funcionality doesn't run in a task. It should be good. And I make a new task like this:

#if NRF_LOG_ENABLED
    // Start execution.
    if (pdPASS != xTaskCreate(logger_thread, "LOGGER", 256, NULL, 1, &m_logger_thread))
    {
        APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
    }
#endif

    if (pdPASS != xTaskCreate(alive_thread, "alive", 256, NULL, 1, &m_alive_thread))
    {
        APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
    }

and the task code is like this:

static void alive_thread(void *arg)
{
    UNUSED_PARAMETER(arg);
    int i=0;
    for(;;) {
        bsp_board_led_invert(BSP_BOARD_LED_2);
        vTaskDelay(500);
        if (++i<10)
                continue;
            i=0;
            NRF_LOG_INFO("tick\r\n");
        }
    }

Unfortunately I got the next message in serial console:

    <error> nrf_sdh_freertos: SoftDevice task not created.
<error> app: Fatal

I used make flash_softdevice and make flash.

thx, Zamek

edit flag offensive delete publish link more
0
bjorn-spockeli gravatar image

answered 2017-08-14 13:23:53 +0100

zamek gravatar image

updated 2017-08-15 16:42:57 +0100

HI Zamek, could you test this with the latest release of the SDK, i.e. SDK v14.0.0 and see if this is still an issue?

edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower

Stats

Asked: 2017-08-12 09:20:12 +0100

Seen: 208 times

Last updated: aug. 15