Can you read the uC's serial number in code?

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

Can you read the uC's serial number in code?

ソリューションへジャンプ
2,481件の閲覧回数
Poley
Contributor V

Hi,

Is there a way to read the chips serial number so I can display it on CAN? 

Thanks!

0 件の賞賛
返信
1 解決策
2,431件の閲覧回数
mariuslucianand
NXP Employee
NXP Employee

Hello @Poley ,

I've seen that error before but I was unable to solve it because I cannot reproduce it on my end.

Regarding reading the UID, the other way s to use Data Read Mem block and type the direct address of the registers. Please see the attached example.

For the second request, restarting the MCU there are basically two ways. One of them is to use the watchdog, the other is to use the AIRCR register of the ARM Core. I tried the last one, and if you press the SW4 this should reset the MCU. Please see the attached exmaple. Also, the count variable is incremented every step time so once you press the button the value starts again from 0. 

Hope this helps,

Marius

元の投稿で解決策を見る

4 返答(返信)
2,471件の閲覧回数
mariuslucianand
NXP Employee
NXP Employee

Hello @Poley 

I think you can try using the Read Register block and accessing the SIM -> UIDH, UIMH, UIML and UIDL.

mariuslucianand_0-1624610065118.png

Hope this helps,

Marius

 

0 件の賞賛
返信
2,467件の閲覧回数
Poley
Contributor V

Hi @mariuslucianand 

I get this error when trying to put a read register block in my model, am I missing something obvious?

Poley_0-1624614354033.png

 

Also, Is there a way to do a device reset from software? I am looking at ways to flash with the CAN bootloader and using a reset switch isn't ideal (8 boards on same bus and supply so can't just power cycle). So a way of resetting the device through software would be perfect.

Thanks!

 

 

0 件の賞賛
返信
2,432件の閲覧回数
mariuslucianand
NXP Employee
NXP Employee

Hello @Poley ,

I've seen that error before but I was unable to solve it because I cannot reproduce it on my end.

Regarding reading the UID, the other way s to use Data Read Mem block and type the direct address of the registers. Please see the attached example.

For the second request, restarting the MCU there are basically two ways. One of them is to use the watchdog, the other is to use the AIRCR register of the ARM Core. I tried the last one, and if you press the SW4 this should reset the MCU. Please see the attached exmaple. Also, the count variable is incremented every step time so once you press the button the value starts again from 0. 

Hope this helps,

Marius

2,428件の閲覧回数
Poley
Contributor V

Hi @mariuslucianand 

Thank you very much for the help!

So it looks like if I use the reset function you have:

Poley_0-1625055325742.png

It looks like I can just change the GPI ISR to a CAN signal that when set to 1 triggers the subsystem containing the reset MCU matlab function, should this reset me all the way to the bootloader code? (Currently just using OpenSDA).

Also for UID do I need to read all 4 registers?:

Poley_1-1625055509599.png

How do I get a single value I can put onto CAN? or is that value too large? 

Thank you again!

 

0 件の賞賛
返信