How to read the address between bootloader and APP

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to read the address between bootloader and APP

ソリューションへジャンプ
757件の閲覧回数
chcd007
Contributor II

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

 

タグ(3)
0 件の賞賛
1 解決策
752件の閲覧回数
jiri_kral
NXP Employee
NXP Employee

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

元の投稿で解決策を見る

0 件の賞賛
1 返信
753件の閲覧回数
jiri_kral
NXP Employee
NXP Employee

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

0 件の賞賛