Introduced a register dump function to display MCU register values of various registers
This commit is contained in:
parent
5e2ebf2fd6
commit
0077cb7398
@ -2,6 +2,7 @@
|
|||||||
#include "app_utils.h"
|
#include "app_utils.h"
|
||||||
#include "app_log.h"
|
#include "app_log.h"
|
||||||
#include "wm_crypto_hard.h"
|
#include "wm_crypto_hard.h"
|
||||||
|
#include "wm_regs.h"
|
||||||
|
|
||||||
static uint32_t _elapsed_ms = 0;
|
static uint32_t _elapsed_ms = 0;
|
||||||
|
|
||||||
@ -91,3 +92,21 @@ uint32_t random_gen_6_digit(void)
|
|||||||
|
|
||||||
return output_num;
|
return output_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void print_reg_full(const char * reg_name, unsigned int addr, uint8_t size)
|
||||||
|
{
|
||||||
|
unsigned int *reg_addr = (unsigned int *)addr;
|
||||||
|
printf("%s :"NEW_LINE, reg_name);
|
||||||
|
for(uint8_t i = 0; i < size; i++)
|
||||||
|
{
|
||||||
|
printf("[0x%08X] => 0x%08X"NEW_LINE, (unsigned int)reg_addr, tls_reg_read32((unsigned int)reg_addr));
|
||||||
|
reg_addr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void register_dump(void)
|
||||||
|
{
|
||||||
|
print_reg_full("PMU REG", HR_PMU_BASE_ADDR, 64);
|
||||||
|
print_reg_full("CLK REG", HR_CLK_BASE_ADDR, 64);
|
||||||
|
print_reg_full("BT MODEM", 0x40012200,128);
|
||||||
|
}
|
||||||
|
@ -38,4 +38,10 @@ uint32_t elapsed_ms(void);
|
|||||||
*/
|
*/
|
||||||
uint32_t random_gen_6_digit(void);
|
uint32_t random_gen_6_digit(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Debug function used to dump register values
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void register_dump(void);
|
||||||
|
|
||||||
#endif //APP_UTILS_H
|
#endif //APP_UTILS_H
|
@ -329,6 +329,7 @@ static void setBLEEnabledCb(bool *enabled, SettingMode_e mode)
|
|||||||
music_player_screen_notify_BLE_connection_state(&musicPlayerScreen, false);
|
music_player_screen_notify_BLE_connection_state(&musicPlayerScreen, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
register_dump();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -837,6 +838,8 @@ void gfx_task(void *param)
|
|||||||
uint32_t ble_info_update_ms = 0;
|
uint32_t ble_info_update_ms = 0;
|
||||||
uint32_t main_data_update = 0;
|
uint32_t main_data_update = 0;
|
||||||
|
|
||||||
|
register_dump();
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user