File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
utils/embedded-test-support Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ void qemu_exit() {
5454}
5555
5656int putchar (int c ) {
57+ // This is only valid in an emulator (QEMU), and it's skipping a proper configuration of the UART device
58+ // and waiting for a "ready to transit" state.
59+
5760 // STM32F1 specific location of USART1 and its DR register
5861 * (volatile uint32_t * )(0x40013800 + 0x04 ) = c ;
5962 return c ;
Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ void qemu_exit() {
5454}
5555
5656int putchar (int c ) {
57+ // This is only valid in an emulator (QEMU), and it's skipping a proper configuration of the UART device
58+ // and waiting for a "ready to transit" state.
59+
5760 // STM32F4 specific location of USART1 and its DR register
5861 * (volatile uint32_t * )(0x40011000 + 0x04 ) = c ;
5962 return c ;
Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ void usart_init() {
3232 * ((volatile char * )0xc1 ) = 1 << 3 ; // enable TX on UART0
3333}
3434
35- __attribute__((used ))
36- static inline void * memcpy_flash_to_sram (void * restrict dst , const void __attribute__((__address_space__ (1 ))) * restrict src , size_t n ) {
35+ void * memcpy_flash_to_sram (void * restrict dst , const void __attribute__((__address_space__ (1 ))) * restrict src , size_t n ) {
3736 for (int i = 0 ; i < n ; i ++ ) {
3837 ((char * )dst )[i ] = ((char __attribute__((__address_space__ (1 ))) * )src )[i ];
3938 }
@@ -46,6 +45,9 @@ void copy_data_from_flash_to_sram() {
4645}
4746
4847int putchar (int c ) {
48+ // This is only valid in an emulator (QEMU), and it's skipping a proper configuration of the UART device
49+ // and waiting for a "ready to transit" state.
50+
4951 // AVR's UART0 DR register
5052 * ((volatile char * )0xc6 ) = c ;
5153 return c ;
You can’t perform that action at this time.
0 commit comments