- nucle board used only for STM-Link to programm external STM32 controller (NUCLEO-L476RG)
- generic STM32 controller development board that contains a LSE (low speed external oscailator), battery, flash storage (https://stm32-base.org/boards/STM32F407VET6-STM32-F4VE-V2.0.html)
- UART usb controller (used to interact with the board)
- STM32 IDE Cube
- PulseView
- screens command line application used to communicated with the board over UART
- connect IDE using STM32 Nucle board (STM-Link part) to generic STM32 development board (https://www.st.com/content/ccc/resource/technical/document/user_manual/98/2e/fa/4b/e0/82/43/b7/DM00105823.pdf/files/DM00105823.pdf/jcr:content/translations/en.DM00105823.pdf);
- using interupt triggered by a button to call a custom callback function; Note: configure the pin with pull up to avoid floating;
- configure LSE to enble RTC (realtime clock), using batter to keep the clock running when the board is disconnected;
- storing state informatin in back up registries to make note if the time is set (the back registries are being meintained by the battery when the board is disconnected from the main power srouce)
/* USER CODE BEGIN Check_RTC_BKUP */
if (HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR0) == 0xcafe) {
return;
} else {
HAL_RTCEx_BKUPWrite(&hrtc, RTC_BKP_DR0, 0xcafe);
}
/* USER CODE END Check_RTC_BKUP */
- connect to the board using UART USB controller;
- implement a simple text menu accessible via UART;
- accessing onboard external FLASH; Note: generic board is using the SPI1 to link to the FLASH; this way have to disable debugging functionality(set Serial Wire for debug option not Trace Asynchronous Sw) since we have to use the pin for SPI1
- logging button click epock time (4 bytes) to external flash
- using PulseView to debug the byte order of the address when reading/storing the 4 bytes to external flash
send_address[2] = temp;
send_address[1] = temp >> 8;
send_address[0] = temp >> 16;