In my program, the Bootloader program starts at address 0 and then jump to app starts at address 0x6040. I need to read 4 bytes of address 0x6000 in the app routine. I used
vl32 = *((*uint32_t)0x6000);
or
vl8 [i] = * ((* uint8_t) (0 x6000 + i)); (i = 0... 3)
two way to read. The result is a reset of the MCU. How can I read the data of this address
Solved! Go to Solution.
Hi,
the first expression can't be compiled - there must be some error message in build console (if it is copy/pasted code snippet).
you can use for example:
data=*(uint32_t*)0x6000;
where data is
uint32_t data;
or you can use memcpy function:
memcpy(target,(uint8_t*)0x6000,4);
where target is:
uint8_t target[4];
Jiri
Hi,
the first expression can't be compiled - there must be some error message in build console (if it is copy/pasted code snippet).
you can use for example:
data=*(uint32_t*)0x6000;
where data is
uint32_t data;
or you can use memcpy function:
memcpy(target,(uint8_t*)0x6000,4);
where target is:
uint8_t target[4];
Jiri