Ported: FreeRTOS 9.0.0

victor_pv
Sun Mar 12, 2017 7:06 pm
I applied the same changes from FreeRTOS 8.2.1 to 9.0.0 and have been using it for some tests successfully.

I need to upload it to Github, then will post the link here. It adds a few new features over 8.x
If anyone wants it before I’ve added a github link, send me a PM.

Now it’s on github:
https://github.com/victorpv/Arduino_STM … reeRTOS900

EDIT:
The PR has been merged and now is part of the main repo on Roger’s github:
https://github.com/rogerclarkmelbourne/ … reeRTOS900

Details on the new features here:
http://www.freertos.org/FreeRTOS-V9.html

For questions or issues you can still post in this thread.


Pito
Sun Mar 12, 2017 7:09 pm
Try with
http://www.stm32duino.com/viewtopic.php?f=3&t=1453
if it compiles..

victor_pv
Sun Mar 12, 2017 10:48 pm
Pito wrote:Try with
http://www.stm32duino.com/viewtopic.php?f=3&t=1453
if it compiles..

victor_pv
Sat Mar 25, 2017 1:38 pm
I have sent a pull request to Roger. The library is now available in a branch of my fork. If anyone wants to download, it’s here:
https://github.com/victorpv/Arduino_STM … reeRTOS900

michael_l
Wed Mar 29, 2017 8:16 pm
It looks like my code crashes at this point when creating mutex. Victor, should mutexes also work ? Please note, I have the same problem with 8.2

SemaphoreHandle_t xMutexSer;
xMutexSer=xSemaphoreCreateMutex();


victor_pv
Wed Mar 29, 2017 8:25 pm
michael_l wrote:It looks like my code crashes at this point when creating mutex. Victor, should mutexes also work ? Please note, I have the same problem with 8.2

SemaphoreHandle_t xMutexSer;
xMutexSer=xSemaphoreCreateMutex();


ag123
Wed Mar 29, 2017 10:36 pm
wow did we actually successfully fit freertos and maybe add an lcd spi display lib and an arduino sketch into that stm32f103 with 16-20k sram & 64k flash :lol:

michael_l
Thu Mar 30, 2017 6:25 am
victor_pv wrote:michael_l wrote:It looks like my code crashes at this point when creating mutex. Victor, should mutexes also work ? Please note, I have the same problem with 8.2

SemaphoreHandle_t xMutexSer;
xMutexSer=xSemaphoreCreateMutex();


victor_pv
Thu Mar 30, 2017 9:48 pm
michael_l wrote:victor_pv wrote:michael_l wrote:It looks like my code crashes at this point when creating mutex. Victor, should mutexes also work ? Please note, I have the same problem with 8.2

SemaphoreHandle_t xMutexSer;
xMutexSer=xSemaphoreCreateMutex();


zmemw16
Fri Mar 31, 2017 1:03 am
@ag123
you forgot the SD card
:)

victor_pv
Fri Mar 31, 2017 2:14 am
zmemw16 wrote:@ag123
you forgot the SD card
:)

victor_pv
Fri Mar 31, 2017 2:21 am
michael_l wrote:

Thanks for the reply. I’ll try to narrow down the cause. In my project I use SPI2, FreeRtos821, SdFAT on SPI1, USB Serial, and Serial1. it may well be that something else is causing this. I’m using platformio to build – it seems to have some differences compared to Arduino IDE build. For example platformio uses -Os and Arduino build uses -Og. I’ll try compiling with Arduino IDE also later.

EDIT: I’ll check my max heap amount also with xPortGetFreeHeapSize() function. Maybe I’m near limits and alloc fails.


michael_l
Fri Mar 31, 2017 11:01 am
Thanks victor_pv. Yes, mutexes are also working now. I somehow knew the problem was in my environment. First I had edited wrong freertosconfig.h and there was too little heap defined. Second: my desktop computer’s first USB port does not want to play ball with stm32 – the second one works. Guess which one I used :)

FreeRTOS does open up many new possibilities.

One question: do you know if the unit for xSemaphoreTake(xSem, 1000) is 1000ms or 1000ticks ? vTaskDelay seems to wait in ms.


Pito
Fri Mar 31, 2017 12:09 pm
Forgot to tell you, but I didn’t test this version with the Arduino IDE, only with the Eclipse-Arduino plugin IDE (sloeber). After I started using it I dont think I have opened the Arduino IDE ever again…
OT: How did you add the stm32duino boards into the Sloeber, plz??
PS: I’ve found the wiki :)

ag123
Fri Mar 31, 2017 12:23 pm
victor_pv wrote:zmemw16 wrote:@ag123
you forgot the SD card
:)

victor_pv
Fri Mar 31, 2017 4:07 pm
ag123 wrote:victor_pv wrote:zmemw16 wrote:@ag123
you forgot the SD card
:)

Pito
Fri Apr 14, 2017 2:29 pm
I tried 9.00 with my sdcard logger (against 8.21, the same code):
1. it compiles
2. the .bin is by 60bytes bigger
3. the jitter (of the actual sample period in us) is much smaller, almost nil
:)

victor_pv
Fri Apr 14, 2017 2:39 pm
Pito wrote:I tried 9.00 with my sdcard logger (against 8.21, the same code):
1. it compiles
2. the .bin is by 60bytes bigger
3. the jitter (of the actual sample period in us) is much smaller, almost nil
:)

victor_pv
Fri Apr 14, 2017 3:05 pm
michael_l wrote:Thanks victor_pv. Yes, mutexes are also working now. I somehow knew the problem was in my environment. First I had edited wrong freertosconfig.h and there was too little heap defined. Second: my desktop computer’s first USB port does not want to play ball with stm32 – the second one works. Guess which one I used :)

FreeRTOS does open up many new possibilities.

One question: do you know if the unit for xSemaphoreTake(xSem, 1000) is 1000ms or 1000ticks ? vTaskDelay seems to wait in ms.


Pito
Fri Apr 14, 2017 3:33 pm
@victor: no change..

Pito
Sat Apr 15, 2017 2:39 pm
Any practical experience with this TraceAnalyzer for FreeRTOS??

https://percepio.com/docs/FreeRTOS/manu … r_FreeRTOS

I cannot get it working with MMini and my Logger. Most possibly it does not fit in ram, when removing the Tracealyzer’s components logger works fine. Tried strip down the various settings, but still no fun..


michael_l
Sat Apr 15, 2017 3:48 pm
Pito wrote:Any practical experience with this TraceAnalyzer for FreeRTOS??

https://percepio.com/docs/FreeRTOS/manu … r_FreeRTOS

I cannot get it working with MMini and my Logger. Most possibly it does not fit in ram, when removing the Tracealyzer’s components logger works fine. Tried strip down the various settings, but still no fun..


Pito
Sat Apr 15, 2017 4:32 pm
Nope, just tried somehow to push it into, but it crashes. No debug yet (debugging of trace analyser :) ). Normally it does not fit into .bss (even with smaller buffers I set in config) linker said (+2k with static alloc for trace buffers), with dynamic alloc it compiled but crashed upon reset. I have to try with my 103ZET6 board, it seems. If it worked it could be an interesting tool, indeed.
Any idea how to make from a folder full of .h and .c a library??? (the tracealyser files).

victor_pv
Sat Apr 15, 2017 8:57 pm
Pito wrote:Nope, just tried somehow to push it into, but it crashes. No debug yet (debugging of trace analyser :) ). Normally it does not fit into .bss (even with smaller buffers I set in config) linker said (+2k with static alloc for trace buffers), with dynamic alloc it compiled but crashed upon reset. I have to try with my 103ZET6 board, it seems. If it worked it could be an interesting tool, indeed.
Any idea how to make from a folder full of .h and .c a library??? (the tracealyser files).

victor_pv
Sat Apr 15, 2017 9:04 pm
Btw, I think the 8kb default heap for rtos is pretty tight, so you need to assign tasks stack carefully. I wonder if the trace analyser may help find out which tasks can have less stack.

Pito
Sun Apr 16, 2017 5:35 pm
Ok, after a morning2EOD Sunday’s exercise here are the first results – 2 LEDs blinking (200ms and 300ms), FR9.0 and the Tracealyzer Basic, latest (via Jlink). Soebler IDE.
Maple Mini, FR heap 2kB.

Tracealyzer 2 LEDs Blinks.JPG
Tracealyzer 2 LEDs Blinks.JPG (105.59 KiB) Viewed 723 times

michael_l
Sun Apr 16, 2017 5:38 pm
Very nice!

Could you write a small how to on WiKi? I was planning to try this also. Also I’m going to try Segger’s SystemView when I get some free time :-)


victor_pv
Sun Apr 16, 2017 5:40 pm
Pito wrote:Ok, after a Sunday’s exercise here are the first results – 2 LEDs blinking (200ms and 300ms), FR9.0 and the Tracealyzer Basic, latest (via Jlink).
Maple Mini, FR heap 2kB.Tracealyzer 2 LEDs Blinks.JPG

Pito
Sun Apr 16, 2017 5:46 pm
Ok, I will do, but tired today. Whole day messed with it..
I did it in Sloeber (because of much easier inclusion of includes). Resigned to do it in Arduino IDE..
Updated pictures with 3 LEDs and larger trace buffer.
Pessimistic if you want to trace something with Serial + SdFat + FR.. Almost impossible with MMini, imho.
Also you must include CMSIS to get it working.
BTW, the free version is extremely stripped down one, the license cost $1.5k :(

Tracealyzer 3 LEDs Blinks detail.JPG
Tracealyzer 3 LEDs Blinks detail.JPG (96.98 KiB) Viewed 689 times

Pito
Mon Apr 17, 2017 12:43 pm
A how-to posted here viewtopic.php?f=41&t=1991&p=26490#p26490

acronis
Tue Aug 01, 2017 3:56 am
Hello.

The library is not available for download ?


Pito
Tue Aug 01, 2017 7:32 am
Always look at first post

http://www.stm32duino.com/viewtopic.php?f=13&t=1884


acronis
Tue Aug 01, 2017 8:21 am
the first post:

Now it’s on github:
https://github.com/victorpv/Arduino_STM … reeRTOS900

??


stevestrong
Tue Aug 01, 2017 8:42 am
Isn’t it this one?
https://github.com/victorpv/Arduino_STM … reeRTOS900

acronis
Tue Aug 01, 2017 8:48 am
Yes.
Thank you very much !
This link works.
Probably need to fix the 1st post.

victor_pv
Tue Aug 01, 2017 1:10 pm
[acronis – Tue Aug 01, 2017 8:48 am] –
Yes.
Thank you very much !
This link works.
Probably need to fix the 1st post.

The PR has now been merged as is part of the main repo:
https://github.com/rogerclarkmelbourne/ … reeRTOS900


acronis
Wed Aug 02, 2017 4:20 am
Hello.

Today, I checked an example ‘rtos_blink’ on the Board STM32F407VET6 – everything works fine !
Thank you very much.


fpiSTM
Thu Aug 03, 2017 2:40 pm
Seems example need to be update: https://github.com/victorpv/Arduino_STM … ink.ino#L3
#include <MapleFreeRTOS821.h>

victor_pv
Thu Aug 03, 2017 4:50 pm
[fpiSTM – Thu Aug 03, 2017 2:40 pm] –
Seems example need to be update: https://github.com/victorpv/Arduino_STM … ink.ino#L3
#include <MapleFreeRTOS821.h>

fpiSTM
Thu Aug 03, 2017 9:36 pm
Welcome ;)

jbaumann
Sat Jul 21, 2018 4:47 pm
One question that might sound stupid: How do I add my own FreeRTOSConfig.h? I would like to make some project-specific adaptions to the values but regardless of what I do the file in FreeRTOS/utility gets used instead. Following the documentation I simply placed the file in the main project directory.

Cheers, Joe


jbaumann
Sun Jul 22, 2018 12:14 pm
Ok, I have played around with it and these are my findings. I’ve tried to add the necessary information for both Arduino IDE and Eclipse…

The following changes are sensible to use it with Eclipse:

Common

  • In FreeRTOS900/utility
    • Remove the sub directory “MemMang” from the build path (see below)
    • Remove the file “heap 1.c” from the build path (see below)
    • Move FreeRTOSConfig.h to FreeRTOSDefaultConfig.h
  • In Project Directory (if in Eclipse)
    • Create a Source Folder named “freeRTOS” (we’ll place the FreeRTOS-files there)
    • Add this Source Folder to the project includes using the path ${ProjDirPath}/freeRTOS
    • Copy the heap-management implementation you want to use into the directory freeRTOS (heap_1.c, heap_3.c or heap_4.c, I suggest heap_4.c)
  • In Project Directory (if in Arduino DIE)
    • Copy the heap-management implementation to the sketch directory
  • In your sketch you could include MapleFreeRTOS900.h, but that includes all potentially necessary includes. I like the explicit approach better. Example if only using tasks:
    #include <FreeRTOS.h>
    #include <task.h>


Leave a Reply

Your email address will not be published. Required fields are marked *