Skip to main content
Senior
October 8, 2025
Solved

Help for porting from MDK to CubeIDE

  • October 8, 2025
  • 3 replies
  • 325 views

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.

Chao_0-1759943091532.png

2. The size of the binary is not correct (88 bytes for an LWIP application is imppossible)

Chao_1-1759943354135.png

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

Best answer by TDK

Are all *.c files within directories marked as Source Locations?

TDK_0-1759947730245.png

 

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.

3 replies

TDK
TDKBest answer
Super User
October 8, 2025

Are all *.c files within directories marked as Source Locations?

TDK_0-1759947730245.png

 

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.

"If you feel a post has answered your question, please click ""Accept as Solution""."
ChaoAuthor
Senior
October 11, 2025

Thank you so much. Also many thanks to Andrew and Pavel.

Now the project compiles okay, but linker still reports errors:

Chao_0-1760181358203.png

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.

Andrew Neil
Super User
October 9, 2025

@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 ...

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Pavel A.
Super User
October 9, 2025

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.