Ported: FreeRTOS 9.0.0

Please do not post requests
victor_pv
Posts: 1855
Joined: Mon Apr 27, 2015 12:12 pm

Re: Ported: FreeRTOS 9.0.0

Post by victor_pv » Fri Mar 31, 2017 2:14 am

zmemw16 wrote:@ag123
you forgot the SD card
:)
The wav player with RTOS, sdcard, display, and PWM audio playing takes I believe around 20KB of flash, and I'm a lousy programmer...
At some point I want to test adding the FFT code that has been posted in the forum to analyze and display the samples. But that is so way down my list...

victor_pv
Posts: 1855
Joined: Mon Apr 27, 2015 12:12 pm

Re: Ported: FreeRTOS 9.0.0

Post by 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.
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... One of the features I love is that you can click on a function name and takes you straight to the source file for it. That, and having all the build files within a subfolder, no more mess in %temp%. I also use extensively a j-link EDU I bought and saves a ton of time debugging.

michael_l
Posts: 364
Joined: Mon Aug 24, 2015 6:11 pm

Re: Ported: FreeRTOS 9.0.0

Post by 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.

User avatar
Pito
Posts: 1729
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Ported: FreeRTOS 9.0.0

Post by 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 :)
Last edited by Pito on Fri Mar 31, 2017 12:51 pm, edited 1 time in total.
Pukao Hats Cleaning Services Ltd.

ag123
Posts: 854
Joined: Thu Jul 21, 2016 4:24 pm

Re: Ported: FreeRTOS 9.0.0

Post by ag123 » Fri Mar 31, 2017 12:23 pm

victor_pv wrote:
zmemw16 wrote:@ag123
you forgot the SD card
:)
The wav player with RTOS, sdcard, display, and PWM audio playing takes I believe around 20KB of flash, and I'm a lousy programmer...
At some point I want to test adding the FFT code that has been posted in the forum to analyze and display the samples. But that is so way down my list...
i'd need to dig into rtos, i've always thought rtos + all that libs, lcd, sdfat, usb etc is too much bloat to fit in 64k flash + 20k ram :lol:

victor_pv
Posts: 1855
Joined: Mon Apr 27, 2015 12:12 pm

Re: Ported: FreeRTOS 9.0.0

Post by victor_pv » Fri Mar 31, 2017 4:07 pm

ag123 wrote:
victor_pv wrote:
zmemw16 wrote:@ag123
you forgot the SD card
:)
The wav player with RTOS, sdcard, display, and PWM audio playing takes I believe around 20KB of flash, and I'm a lousy programmer...
At some point I want to test adding the FFT code that has been posted in the forum to analyze and display the samples. But that is so way down my list...
i'd need to dig into rtos, i've always thought rtos + all that libs, lcd, sdfat, usb etc is too much bloat to fit in 64k flash + 20k ram :lol:
RTOS seems to take about 1KB of flash or so. The RAM is managed in a different way, so it's a different story how to calculate it, but it's supposed to take very little RAM for the RTOS itself, most RAM used will come from creating semaphores, queues, etc. Version 9 add static allocation for that stuff, so it does't come from the RTOS heap, and you can better estimate how much RAM you are using (if you use static allocation). I haven't started using that yet though.
Last edited by victor_pv on Fri Apr 14, 2017 2:40 pm, edited 1 time in total.

User avatar
Pito
Posts: 1729
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Ported: FreeRTOS 9.0.0

Post by 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
:)
Pukao Hats Cleaning Services Ltd.

victor_pv
Posts: 1855
Joined: Mon Apr 27, 2015 12:12 pm

Re: Ported: FreeRTOS 9.0.0

Post by 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
:)
Nice, did you do any change whatsoever to the code other than including v9 vs 8.21? If not, I guess the scheduler is better now.

victor_pv
Posts: 1855
Joined: Mon Apr 27, 2015 12:12 pm

Re: Ported: FreeRTOS 9.0.0

Post by 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.
I think it is supposed to count ticks, but as a matter of fact the systick is set to 1ms overflow, so 1tick = 1ms.
I think there is some upper or lower limit on how frequent ticks need to be, but don't remember it. Check if it you decide to change it, but seems like using the 1ms tick is convenient.

User avatar
Pito
Posts: 1729
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Ported: FreeRTOS 9.0.0

Post by Pito » Fri Apr 14, 2017 3:33 pm

@victor: no change..
Pukao Hats Cleaning Services Ltd.

Post Reply