cancel
Showing results for 
Search instead for 
Did you mean: 

why I can only run *(__IO uint32_t *)(0x6C000000) = data; from main.c

MNapi
Senior III

I am trying to use FMC and I am using

*(__IO uint32_t *)(0x6C000000) = data

to send the data

but it only works from main.c I had bunch libraries included in other files too.

when I try to create new c file and put there I am getting errors. Can anybody help with this ?

compiling NT35510_800x480.c...

..\Core\Src\NT35510_800x480.c(17): error: #40: expected an identifier

 *(

_IO uint8_t *)(0x6C000000) = data;

..\Core\Src\NT35510_800x480.c(17): error: #79: expected a type specifier

 *(

_IO uint8_t *)(0x6C000000) = data;

..\Core\Src\NT35510_800x480.c(17): error: #145: function "<error>" may not be initialized

 *(

_IO uint8_t *)(0x6C000000) = data;

..\Core\Src\NT35510_800x480.c: 0 warnings, 3 errors

"SN0009 IC1 STM32L4S9ZIT6\SN0009 IC1 STM32L4S9ZIT6.axf" - 3 Error(s), 0 Warning(s).

3 REPLIES 3

Replace _IO with volatile ​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
MNapi
Senior III

I checked all possible examples from CubeMX and __IO is used to transfer data through FMC but all their examples are in main.c file

do you mean

*(__IO uint32_t *)(0x6C000000) = data

changing to:

*(volatile uint32_t *)(0x6C000000) = data

it does not seem to be working I still get after doing it:

compiling NT35510_800x480.c...

..\Core\Src\NT35510_800x480.c(17): error: #40: expected an identifier

 *(volatile uint32_t *)(0x6C000000) = data;

..\Core\Src\NT35510_800x480.c(17): error: #79: expected a type specifier

 *(volatile uint32_t *)(0x6C000000) = data;

..\Core\Src\NT35510_800x480.c(17): error: #145: function "<error>" may not be initialized

 *(volatile uint32_t *)(0x6C000000) = data;

..\Core\Src\NT35510_800x480.c: 0 warnings, 3 errors

Perhaps there's a syntax error or you're missing some include files.

Start looking at the source, starting with the first error.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..