Debugging tool for mbed enabled microcontrollers, especially for NUCLEO-F303RE and STM32F042F6P6.
Diff: debug_register.cpp
- Revision:
- 11:90164cad21ed
- Parent:
- 9:59344a584e18
- Child:
- 12:a8ab6e018422
--- a/debug_register.cpp Thu May 09 21:14:13 2019 +0000 +++ b/debug_register.cpp Thu May 09 21:24:31 2019 +0000 @@ -55,7 +55,7 @@ //reg = *((volatile unsigned int *)address); pc.printf("---------------------------------------------------------------------------------------------------------\n\r"); - pc.printf("| address decimal %10u | address hex 0x%8x | value decimal %10u | value hex 0x%8x |\n\r",address,address, reg, reg); + pc.printf("| address hex 0x%8x | value hex 0x%8x | address decimal %10u | value decimal %10u |\n\r", address, reg, address, reg); pc.printf("---------------------------------------------------------------------------------------------------------\n\r"); pc.printf("|bit_num|31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|\n\r"); pc.printf("---------------------------------------------------------------------------------------------------------\n\r|bit_val|"); @@ -83,16 +83,16 @@ }else if (sign == 'r' || sign == 'R'){ pc.printf("\r\e[K\e[12;0H\r\e[K\e[32;40m use l or j to xyzzzzzzzzx\e[97;40m"); pc.printf("\e[6;46H"); - address = modify_value(address, 46); + address = modify_value(address, 17); continue; }else if (sign == 'w' || sign == 'W'){ pc.printf("\r\e[K\e[12;0H\r\e[K\e[32;40m use l or j to xxxxxxxxxxx\e[97;40m"); pc.printf("\e[6;46H"); - address = modify_value(address, 46); + address = modify_value(address, 17); pc.printf("\e[12;0H\r\e[K\e[32;40m use l or j to yyyyyyyx\e[97;40m"); pc.printf("\e[6;96H"); reg = *((volatile unsigned int *)address); - reg = modify_value(reg, 96); + reg = modify_value(reg, 40); *((volatile unsigned int *)address) = reg; continue; }else{