Skip to content

First version based on FreeRTOS 9.0.0 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 15, 2018

Conversation

fpistm
Copy link
Member

@fpistm fpistm commented Jan 5, 2018

Based on FreeRTOS-9.0.0 modified by ST and provided within the STM32CubeFw

Portable layer supported dynamically:

  • ARM_CM0
  • ARM_CM3
  • ARM_CM4
  • ARM_CM7

Allow user to use his own FreeRTOS configuration file named STM32FreeRTOSConfig.h in his sketch folder.

Added one custom configuration in FreeRTOS configuration file:

/* Begin custom definitions for STM32 */
/* Default (3) Memory allocation implementations (heap_[1-5].c) */
/*#define configMEMMANG_HEAP_NB             3*/
/* End custom definitions for STM32 */

This mean the default Memory allocation implementations provided by FreeRTOS is heap_3.c and could be changed thanks the configuration file (configTOTAL_HEAP_SIZE is not use with heap_3.c).

Require this PR at core side:
stm32duino/Arduino_Core_STM32#190

fpistm added 3 commits January 5, 2018 10:39
Signed-off-by: Frederic.Pillon <[email protected]>
Avoid Arduino to build all sources file.

Signed-off-by: Frederic.Pillon <[email protected]>
@straccio
Copy link

straccio commented Jan 11, 2018

On top of the generic port.c file i have added these lines because with the STM32F429ZI board it always include the ARM_CM0/port.c invece che ARM_CM3F/port.c

#ifndef __CORTEX_M
#pragma GCC error  "no \"__CORTEX_M\" definition"
#endif

and when i try to build it catch this error!

@fpistm
Copy link
Member Author

fpistm commented Jan 11, 2018

Hum... right... Nice shot. I thought I've tested each include... :'(
I don't know what I've done... it misses some includes.
__CORTEX_M is defined by CMSIS

I will add also your guard if __CORTEX_M is not defined
I update the PR with the corrections

@straccio
Copy link

Same in portmacro.h

@fpistm
Copy link
Member Author

fpistm commented Jan 11, 2018

Yes, seen ;)

@fpistm
Copy link
Member Author

fpistm commented Jan 11, 2018

Now it should be ok

@straccio
Copy link

Ok, it works good!
I have tested some examples and my Multiplatform domotic sources!

PS: in port.c i have included only "stm32_def.h" no "FreeRTOS.h"

@fpistm
Copy link
Member Author

fpistm commented Jan 11, 2018

I include the FreeRTOS.h to have the config included for configMPU_NOT_SUPPORTED.
When supported I will remove this define and replace include by stm32_def.h

@fpistm fpistm force-pushed the FreeRTOS-9.0.0 branch 2 times, most recently from 971b503 to c25e874 Compare January 12, 2018 15:08
Add a file named "STM32FreeRTOSConfig.h" in the sketch folder
will be used instead of the default config

Signed-off-by: Frederic.Pillon <[email protected]>
Signed-off-by: Frederic.Pillon <[email protected]>
Signed-off-by: Frederic.Pillon <[email protected]>
Signed-off-by: Frederic Pillon <[email protected]>
@fpistm
Copy link
Member Author

fpistm commented Jan 14, 2018

MPU support is fully disabled as it required several config (mainly dependant of the linker script).
Made some cleanup and update README.md

Required config:
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTaskGetIdleTaskHandle 1

Signed-off-by: Frederic Pillon <[email protected]>
Signed-off-by: Frederic Pillon <[email protected]>
@fpistm fpistm merged commit 6b21a18 into stm32duino:master Jan 15, 2018
@fpistm fpistm deleted the FreeRTOS-9.0.0 branch January 15, 2018 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants