Reading CPU registers

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

Reading CPU registers

859件の閲覧回数
luke_ludington
Contributor II

I want to get the value of a register on the CPU, I looked on the spec sheet and found the address (0xE000E014) and I want to name the variable I store the value in "subticks_per_tick"

This is on a TWR-K65F180M running FreeRTOS.

register uint64_t 0xE000E014 asm ("subticks_per_tick");register uint64_t subticks_per_tick asm ("0xE000E014");

first line gets: error: expected identifier or '(' before numeric constant

second line gets: invalid register name for 'subticks_per_tick'

Any other ways of accessing hardware tick would also be super helpful

タグ(3)
0 件の賞賛
返信
1 返信

772件の閲覧回数
mjbcswitzerland
Specialist V

Hi Luke

unsigned long ulValue = *(unsigned long *)(0xe000e000 + 0x014);

This is the SYSTICK reload value (24 bits are valid/implemented) so you won't need a 64 bit variable to copy it to.
You should avoid assembler since C coding will do it just as efficiently and is compiler independent.


Regards

Mark

Complete Kinetis solutions for professional needs, training and support: http://www.utasker.com/kinetis.html
Including FreeRTOS integration for all Kinetis parts (with free running UART DMA Rx method)
Kinetis K66:
- http://www.utasker.com/kinetis/TWR-K65F180M.html
- http://www.utasker.com/kinetis/FRDM-K66F.html
- http://www.utasker.com/kinetis/TEENSY_3.6.html
uTasker: supporting >1'000 registered Kinetis users get products faster and cheaper to market
Request Free emergency remote desk-top consulting at http://www.utasker.com/services.html

0 件の賞賛
返信