cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX bad macro generation (bug)

Eugene S.
Associate III
Posted on December 24, 2016 at 15:15

I use STM32CubeMX v4.0. It generates MX_Device.h file for configuring CMSIS-Drivers. I found that there are some macroses use hyphen symbol, which is not allowed:

/*-------------------------------- SYS --------------------------------*/
#define MX_SYS 1
/* GPIO Configuration */
/* Pin PE2 */
#define MX_SYS_TRACECLK_Pin PE2
#define MX_TRACECLK SYS_TRACECLK
/* Pin PA13 */
#define MX_SYS_JTMS-SWDIO_Pin PA13
#define MX_SWDIO SYS_JTMS-SWDIO
/* Pin PE3 */
#define MX_SYS_TRACED0_Pin PE3
#define MX_TRACED0 SYS_TRACED0
/* Pin PA14 */
#define MX_SYS_JTCK-SWCLK_Pin PA14
#define MX_SWCLK SYS_JTCK-SWCLK
/* Pin PE6 */
#define MX_SYS_TRACED3_Pin PE6
#define MX_TRACED3 SYS_TRACED3
/* Pin PE4 */
#define MX_SYS_TRACED1_Pin PE4
#define MX_TRACED1 SYS_TRACED1
/* Pin PE5 */
#define MX_SYS_TRACED2_Pin PE5
#define MX_TRACED2 SYS_TRACED2�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

1 ACCEPTED SOLUTION

Accepted Solutions
Posted on September 13, 2017 at 10:55

Hello

,

Great thanks for your inputs.

I am able to reproduce it at my end.

The point is that MX_Device.h is generated by Cube, based on a ftl template coming from ARM.

You can find it in the F4 package, downloaded from ARM, here:

C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.0\MDK\CubeMX

Waiting for ARM correction, you can replace the MX_Device_h.ftl template by the one I upload.

Thus, we are submitting a ticket to ARM.

Hope it help you

Kind regards

Sirma

________________

Attachments :

MX_Device_h.ftl.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyS0&d=%2Fa%2F0X0000000b7n%2F6sgeMKvFhVLLcheml9DYPVOMO1SYMLEiz071VjoOBAo&asPdf=false

View solution in original post

6 REPLIES 6
Seb
ST Employee
Posted on December 24, 2016 at 16:01

Hi Eugene,

I've passed your note to the CubeMX team.

Thanks!

Eugene S.
Associate III
Posted on April 09, 2017 at 12:24

Hi

marsanne.sebastien

,

Do you have any plans to fix the bug?

The bug still exists in v 4.1

Posted on September 12, 2017 at 18:18

Hello

Yauhen.Sinkevich

;

Could you please let me know on which family you have observed this error ?

Great thanks in advance.

Kind regards

Sirma

Posted on September 12, 2017 at 18:21

Hello

SIRY.Marc

,

It is STM32F4

Best regards,

Eugene.

Posted on September 13, 2017 at 10:55

Hello

,

Great thanks for your inputs.

I am able to reproduce it at my end.

The point is that MX_Device.h is generated by Cube, based on a ftl template coming from ARM.

You can find it in the F4 package, downloaded from ARM, here:

C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.0\MDK\CubeMX

Waiting for ARM correction, you can replace the MX_Device_h.ftl template by the one I upload.

Thus, we are submitting a ticket to ARM.

Hope it help you

Kind regards

Sirma

________________

Attachments :

MX_Device_h.ftl.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyS0&d=%2Fa%2F0X0000000b7n%2F6sgeMKvFhVLLcheml9DYPVOMO1SYMLEiz071VjoOBAo&asPdf=false
Posted on September 13, 2017 at 11:06

Thanks,

SIRY.Marc

, for the bug fix!