46 uint32_t buf[READ_NBYTES/4];
51 print_welcome(
"nvm-read");
55 while(CRM->STATUSbits.VREG_1P5V_RDY == 0) {
continue; }
56 while(CRM->STATUSbits.VREG_1P8V_RDY == 0) {
continue; }
58 printf(
"Sys cntl %08x\n\r", (
unsigned int)CRM->SYS_CNTL);
59 printf(
"vreg cntl %08x\n\r", (
unsigned int)CRM->VREG_CNTL);
60 printf(
"crm status %08x\n\r", (
unsigned int)CRM->STATUS);
62 if(NVM_INTERFACE == gNvmInternalInterface_c)
64 printf(
"Detecting internal nvm\n\r");
66 printf(
"Setting up gpio\r\n");
68 GPIO->FUNC_SEL.GPIO_04 = 1;
69 GPIO->FUNC_SEL.GPIO_05 = 1;
70 GPIO->FUNC_SEL.GPIO_06 = 1;
71 GPIO->FUNC_SEL.GPIO_07 = 1;
72 printf(
"Detecting external nvm\n\r");
75 err = nvm_detect(NVM_INTERFACE, &type);
77 printf(
"nvm_detect returned: 0x%02x type is: 0x%08x\r\n", err, (
unsigned int)type);
81 err = nvm_read(NVM_INTERFACE, type, (uint8_t *)buf, READ_ADDR, READ_NBYTES);
82 printf(
"nvm_read returned: 0x%02x\r\n", err);
84 for(i=0; i<16/4; i++) {
85 printf(
"0x%08x\r\n", (
unsigned int)buf[i]);
void uart_init(const unsigned int uart_num, uint32_t module_clk_hz, const uint32_t baud)
Initialize UART.
int main(void)
This is main...
#define UART1
Peripheral UART1 base pointer.