in KSDK 1.1.0 board clock configuration is in platform/startup/chipname/system_chipname.h.
The clock configuration is board relative variable.
Support we have several boards which have the same MCU chip and have the different external clock, for the current KSDK, how to describe this scenario ?
Solved! Go to Solution.
Hi!
Certainly in system_mcu.h you set the external clock reference speed and you could change this parameter for each of your boards but this means you would need to recompile the library each time you switch board. Instead of this I recommend to add jumpers to your boards, then you will need to modify the system initialization to add use the correct macro that matches the jumper configuration. This would be the easiest way to handle multiple clock configurations without the need to rebuild KSDK library any time you use a different board.
Regards,
Carlos
Hi,
Do you mean add board macro to system_mcu.h ? While this head file is board independent.
Yes, at the end of the day the macro that indicates the external clock reference is in that file, and any change about the xtal should be made in this file. Then, this file is board independent only if you use the same clock reference value.
Regards,
Carlos
in boards hardware_init.c we still see fixed int xtal value, that will be conflict with other place xtal value.
Hi Haidong,
Actually, all the changes in startup code are made in compilation time. The initialization code is in the KSDK library and the application will not see this code.
On the other hand hardware_init.c contains functions that are called in the application code and this way you can reconfigure the mcu after being initialized.
Regards,
Carlos
We need move the xtal configuration from this chip head file to board head file.