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() {
54
54
}
55
55
56
56
int 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
+
57
60
// STM32F1 specific location of USART1 and its DR register
58
61
* (volatile uint32_t * )(0x40013800 + 0x04 ) = c ;
59
62
return c ;
Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ void qemu_exit() {
54
54
}
55
55
56
56
int 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
+
57
60
// STM32F4 specific location of USART1 and its DR register
58
61
* (volatile uint32_t * )(0x40011000 + 0x04 ) = c ;
59
62
return c ;
Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ void usart_init() {
32
32
* ((volatile char * )0xc1 ) = 1 << 3 ; // enable TX on UART0
33
33
}
34
34
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 ) {
37
36
for (int i = 0 ; i < n ; i ++ ) {
38
37
((char * )dst )[i ] = ((char __attribute__((__address_space__ (1 ))) * )src )[i ];
39
38
}
@@ -46,6 +45,9 @@ void copy_data_from_flash_to_sram() {
46
45
}
47
46
48
47
int 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
+
49
51
// AVR's UART0 DR register
50
52
* ((volatile char * )0xc6 ) = c ;
51
53
return c ;
You can’t perform that action at this time.
0 commit comments