Skip to content
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

bluepill_f103c8 cannot buil mbed-rtos without specific build_flags #15

Open
justgook opened this issue Oct 10, 2016 · 6 comments
Open
Labels

Comments

@justgook
Copy link

justgook commented Oct 10, 2016

if not set any build flag RTOS fail with error:
~/.platformio/packages/framework-mbed/rtos/rtx/TARGET_CORTEX_M/RTX_CM_lib.h:609:2: error: #error "no target defined"

by looking what is inside that file i found closest TARGET_STM32F103RB - so need to add build_flags = -D TARGET_STM32F103RB in platformio.ini to be to be able build.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38255605-bluepill_f103c8-cannot-buil-mbed-rtos-without-specific-build_flags?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github).
@zgoda
Copy link
Contributor

zgoda commented Oct 10, 2016

Until we get official mbed-rtos porting guide consider this board is not rtos capable (only mbed-lib or "mbed classic"). I've been told earlier this year it has not enough flash memory to support rtos but things may have changed since then. Anyway, I will not begin porting rtos until porting guide is released.

@justgook
Copy link
Author

so - today i try few more coding with rtos - and i got why it is totally useless on BluePill - after creating simple (REALLY SIMPLE) application that runs 2 leds and send some message to serial - i went out of memory - so do some RTOS (mbed-rtos) on bluepill is totally useless.
so my suggestion is close that ticket and add some info in documentation - "RTOS is possible run on BluePill, but You can run only Blink app, where 99% (of total MCU flash ) took mbed-rots + 2 threads"

@zgoda
Copy link
Contributor

zgoda commented Oct 11, 2016

After merging mbed "classic" (or "mbed-lib") with mbed-os much of bloat has been introduced to the point that boards with less than 128KB flash are almost unusable, even if none of rtos features are used. Simple program that blinks onboard led and doing any communication over serial compiles to ~55KB firmware. I see no reasonable way out of this situation, the only solution would be to fork mbed classic from just before merge and maintain this unofficial fork, but considering the size of the framework it is not a "reasonable solution". Or is it?

@justgook
Copy link
Author

yup - totally agree - it totally useless - maybe it is time to look to some other Framework / RTOS. For such modules.. as I see there was some tickets (issues) about ChibiOS/RT, FreeRTOS & NuttX so would be nice to try something like that also for those uder128KB STM chips.. (i could try, but cannot find starting point, on how create new framework / lib )

@Testato
Copy link

Testato commented Nov 26, 2016

first tip:
bluepill use F103c8, the datasheet tell that it have only 64KB but in reality it ave 128KB :-)
but st-link open source version do not add it officlially, so platformio, that use st-link open source version, cannot upload abobe 64KB
But if you compile by platformio, and after manually use the firmware.bin by st-link official utility (windows program), you can normally upload your code of 128KB
stlink-org/stlink#516

second tip:
mbed-os is not the only one official version of mbed. Is there the mbed-classic too, it is officially mantained, and it do not include the rtos. So if you need rtos you can use mbed-os or mbed-classic+rtos.h
When you do not need rtos, by using the mbed-classic you will create a very small .bin firmware.
This is because on mbed-os the main() itself is a thread, so you always use rtos also on a blink if you use mbed-os.

For give to the user a very clean mbed experience, Platformio need two different framework:
https://community.platformio.org/t/mbed-double-framework/962
platformio/platformio-core#819

third tip:
instead of bluepill initialization, i use the nucleo initialization for the bluepill. in this way you need only #include "rtos.h" in you main.cpp

@Testato
Copy link

Testato commented Nov 26, 2016

the only solution would be to fork mbed classic from just before merge and maintain this unofficial fork

mbed-classic is not "merged" inside mbed-os. It is added to mbed-os, but it is a separate project.
mbed-classic is not present on github, only mbed-os (that include mbed-classic) is on github

the official repository for mbed-classic is this, and it is updated 2 day ago to ver 130
https://developer.mbed.org/users/mbed_official/code/mbed/shortlog

An official platformio framework for mbed-classic need this repo, not the mbed-classic piece included on mbed-os. In this way Platformio will have two completely separate framework without confusion on version.
An example, on stm32F103 was there a serious bug on wait() function, it is solved on ver130, and it is already on mbed-classic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants