How to edit installed packages loader project to correct device clock overrun with external crystal
Hello, Using Gigadevice GDF32F305 with a 16MHz crystal the loader fails. Looking at the code it is the same issue that I found for the GDF103 family. The loader tries to enable the external crystal and if found it uses the PLL to clock at 120MHz. But this always assumes that the external crystal is 8MHz. If you use a 16MHz then this fails as the device is running too fast and you cannot load your code. The #define that needs commenting out is in SystemGDF30X.c
#define __SYSTEM_CLOCK_120M_PLL_HXTAL (uint32_t)(120000000)
using any of the defines for the internal RC oscillator will work.
//#define __SYSTEM_CLOCK_IRC8M (uint32_t)(__IRC8M)
//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000)
//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000)
//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000)
//#define __SYSTEM_CLOCK_120M_PLL_IRC8M (uint32_t)(120000000)
If I modify the file and select the internal RC oscillator and then try to build I get the error...
cannot use executable file 'C:/Users/Stephen/AppData/Local/Rowley Associates Limited/CrossWorks for ARM/v4/packages/targets/GD32F30x/CMSIS/Flash/GD32F30x_CL.FLM' as input to a link
The installed package project appears to be locked or protected? How do I modify the loader to suit my hardware? I think this is a common issue with all device variants. It would be better if the Loader just relied on the internal RC oscillator and didn't try to use an external crystal.
Can anyone help please? Thanks.
-
The error is caused by a change of behaviour in newer versions of the GNU linker.
You should be able to build the loader using CrossWorks for ARM version 4.7.3 which the package was originally built with.
Older releases of CrossWorks for ARM can be downloaded from https://www.rowley.co.uk/arm/releases.htm and can be installed along side other versions.
Thanks for bringing this to our attention, we'll update the package and fix this issue.
-
Hello John,
Thanks for the very quick response.
I've just done what you have suggested and the modified loader now works perfectly. I created a copy of the loader directory and then put the new .elf file back in the original location overwriting the older version. This issue is now closed. :-)
Thanks Stephen Wright
Please sign in to leave a comment.
Comments
3 comments