ARMmbed / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
4.67k stars 2.97k forks source link

TARGET_STM32F303xC: SetSysClock() missing #15489

Open tmsick1990 opened 8 months ago

tmsick1990 commented 8 months ago

Description of defect

I generated a custom target DISCO_F303VC from STM (STM32F3DISCOVERY) When i want to compile the code i get this error:

C:/projects/mbed-os/mbed-os/targets/TARGET_STM/mbed_overrides.c:286: undefined reference to SetSysClock' CMakeFiles/my-mbed.dir/mbed-os/targets/TARGET_STM/sleep.c.obj: In functionhal_deepsleep': C:/projects/mbed-os/mbed-os/targets/TARGET_STM/sleep.c:272: undefined reference to `SetSysClock' collect2.exe: error: ld returned 1 exit status ninja: build stopped: subcommand failed. ERROR: CMake invocation failed!

I have seen that inside the TARGET_STM32F303xC there is no system_clock.c file is that correkt? Also i tried to compile it with the TARGET_STM32F303xE that has a system_clock.c and it works. So what i have to do?

My custom_targets.json { "DISCO_F303VC": { "inherits": [ "MCU_STM32F303xC" ], "device_name": "DISCO_F303VC", "core": "Cortex-M4", "supported_toolchains": ["GCC_ARM" ], "device_has_add": ["CLOCK_SOURCE_PLL", "CLOCK_SOURCE_HSE" ], "macros_add": ["HSE_VALUE=8000000", "HSE_STARTUP_TIMEOUT=100", "HSE_PREDIV_VALUE=1" ], "extra_labels_add": ["STM32F303xC" ] } }

My mbed_app.json { "target_overrides": { "DISCO_F303VC": { "target.clock_src": { "help": "Clock source to use, can be XTAL or RC", "value": "USE_PLL_HSI" }, "target.clock_freq": { "help": "Clock frequency in Mhz", "value": "16", "macro_name": "CLOCK_FREQUENCY_MHZ" } } } }

Right now I getting in touch with mbed os to start a whole project.

Target(s) affected by this defect ?

STM32F303xC

Toolchain(s) (name and version) displaying this defect ?

GCC_ARM

What version of Mbed-os are you using (tag or sha) ?

master

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

mbed cli 2

How is this defect reproduced ?

To reproduce the error you have to install mbed os CLI 2, and make a new project and then put the custom_targets.json and the mbed_app.json inside the projet and make mbed-tools compile -t GCC_ARM -m DISCO_F303VC.

mbedmain commented 8 months ago

@tmsick1990 thank you for raising this issue.Please take a look at the following comments:

Could you add some more detail to the description? A good description should be at least 25 words. How can we reproduce your issue?

NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'. This indicates to us that at least all the fields have been considered. Please update the issue header with the missing information.

jeromecoutant commented 8 months ago

Hi I didn't verify if this is working, but you can check "old" code: https://github.com/ARMmbed/mbed-os/tree/5.15.2/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/TARGET_DISCO_F303VC