2025-10-08 10:47 AM
Hi
I am trying to port an example application from MDK to CubeIDE, the CubeIDE does not give me correct compilation result:
1. It completes the compilation when code contains syntax error and it produces binary. This is quite different from past experiences with CubeIDE.
2. The size of the binary is not correct (88 bytes for an LWIP application is imppossible)
3. The CubeMX does not generate startup code startup_stm32f767igtx.s
4. There's a warning: cannot find entry symbol Reset_Handler
5. MDK uses ARM compiler, therefore how to rewrite the following delarations in CubeIDE:
#if !(__ARMCC_VERSION >= 6010050) /* not AC6 compiler */
/* use AC5 compiler */
/* the following 3 declarations are reported syntax error by CubeIDE */
/* internal SRAM */
static __align(64) uint8_t mem1base[MEM1_MAX_SIZE]; /* external SDRAM */
static __align(64) uint8_t mem2base[MEM2_MAX_SIZE] __attribute__((at(0XC01F4000))); /* internal DTCM */
static __align(64) uint8_t mem3base[MEM3_MAX_SIZE] __attribute__((at(0X20000000)));
... ...Thanks!
Chao
Solved! Go to Solution.
2025-10-08 11:23 AM
Are all *.c files within directories marked as Source Locations?
There is no GCC-equivalent for the "__attribute__((at(0XC01F4000)))" attribute. You can define a new section in the linker and place them in that section.
2025-10-08 11:23 AM
Are all *.c files within directories marked as Source Locations?
There is no GCC-equivalent for the "__attribute__((at(0XC01F4000)))" attribute. You can define a new section in the linker and place them in that section.
2025-10-09 7:03 AM
@Chao wrote:1. It completes the compilation when code contains syntax error and it produces binary.
Are those real syntax errors, or just the editor incorrectly highlighting them as errors?
eg, see: CubeIDE incorrectly flags __attribute__((fallthrough)) as syntax error.
@Chao wrote:This is quite different from past experiences with CubeIDE.
It's not uncommon!
(it's likely down to Eclipse - not specific to CubeIDE)
@Chao wrote:2. The size of the binary is not correct (88 bytes for an LWIP application is imppossible)
As @TDK said, this suggests that not all your files are being compiled.
You can see what's being compiled in the build console window ...
2025-10-09 9:02 AM - edited 2025-10-09 9:04 AM
In addition to other suggestions: this condition is wrong because it does not detect the GCC compiler:
#if !(__ARMCC_VERSION >= 6010050) /* not AC6 compiler */To detect GCC use:
#if defined ( __GNUC__ )
If you are still confused and need help with updating your project, help is available here.
2025-10-11 4:20 AM - last edited on 2025-10-13 2:34 AM by Andrew Neil
Thank you so much. Also many thanks to Andrew and Pavel.
Now the project compiles okay, but linker still reports errors:
I think this should be caused by my modifications in linker script. I will write a seperate post for this.
chao
The new thread:
Help on linker script modifications for use of external SDRAM and LCD driver.