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

FreeRTOS on NRF51822

Hi

I've just seen Nordic has ported FreeRTOS into the NRF5x series. Have you been using it together the S110? What's your experience? Could I use it together any SoftDevice S110 version? I fear about memory resources problems.

Thanks in advance

Elena

  • Hello.

    The nRF5 SDK (SDK 11 and newer) only supports Softdevice S130 and S132. That being said, you will probably be able to run the examples on S110 as well.

    If you use SDK 10, you will find projects for S110. I advice you to use the latest version if possible.

    I have used the "ble_app_hrs_freertos" example from SDK 11 alpha. I extended it with a second 200 Hz task, and some message queues. It is working fine. I have used it on the nRF52, so memory has not been a concern for me.

    When i compile the "ble_app_hrs_freertos" for S110 (in SDK 10), the memory size output is about 8,6K. This is quite a alot if you are using the 16K version of the nRF51.

    -Anders

  • Hi. Thanks for your reply. Your comments have encouraged me to test the FreeRTOS together to the S110. But my experience is not as good as yours. I'm not able to start the RTOS. Looks I'm having problems related to management of memory. When trying to create the firs task, looks that the RTOS stucks at this point:

    pxNewTCB->pxStack = pxStack (tasks.c, line 3111)

    Which heap file are you using? Could be a problem related to a bad configuration of the FreeRTOS. I've limited the heap memory to 2048KB... for example. I'm using a NRF51822 with 16KB, so not too much RAM memory availabile. Tomorrow I'll make some enquiries, but any advice should be helpfully to try to fix this problem.

    Thanks in advance

    Elena

    UPDATE: Hi again. I'm testing with the NRF51422 (32KB RAM), and I've update SD and all the headers. But I'm having the same problem. The app enters in hard fault when arrives to pxNewTCB->pxStack = pxStack (tasks.c, line 3111). I'm checking the hrs & freertos example but I see no differences. I'm using as environment Eclipse and GCC... Could be this the reason I'm not able to make it work the Freertos???? Thanks again

    UPDATE 2: Finally I've been able to get FreeRTOS working, although because the new SDK is not compatible with mine, I've not been able to test it with Bluetooth working. Two problems I've found: -I didn't see there has to be defined the followint symbols when compiling: BLE_STACK_SUPPORT_REQD __STACK_SIZE=2048 __HEAP_SIZE=1024 S110 BOARD_PCA10028 SOFTDEVICE_PRESENT NRF51 FREERTOS -The startup file for gcc compiler is not correct. See my other thread (devzone.nordicsemi.com/.../). Its necessary to fix this in order to boot FreeRTOS

    Regards,

    Elena

  • Are you using the latest S110 version, SDK and 32kB RAM variant of nRF51?

  • Thanks for your reply. I'm not using yet the latest S110, and until next week I could not test the SW on a 32KB RAM processor. But what I see is an erratic behaviour on the execution. It is a non-sense that in If conditions (without memory modification) or pointer assignations the system crashes. Should I explain this because I'm not using the latest versions? Thanks in advance

  • The s110 will use about 8,2 K of RAM. When the application is using 8,5, it is clear that 16K ram is not enough. You must get a 32 K ram version of the nRF51, in order to make the freertos application run. (Of coarse, you can try to optimize the application to use less RAM).

Related