To add your own computer, you need to at least create one source file containing the parameters and peripherals of your device. After that, add an entry inside Makefile.objs, under qemu / hw / arm /. Recording Machine STM32 P103 .
Take Olimex STM32 P103 Development Board as an example: Olimex STM32 P103 Developer Board Code . In lines 105 and 106 we have flash_size and ram_size. On lines 114 and 115, the code adds an LED to pin GPIO A 0. On line 130 we give a description of the machine "Olimex STM32 p103 Dev Board". On line 131, the machine initialization function: stm32_p103_init. Another example of a machine is more complete: pebble machine code .
On peripheral devices, they are created in each family code, taking into account the case of stm32. Family stm32f1: stm32f1xx.c , stm32f2 family: stm32f2xx.c, stm32f4 family: stm32f4xx.c. The periphery itself is implemented in the driver, which usually has a suggestive name: stm32f2xx_adc.c, stm32f2xx_crc.c and so on. An example of a patch that adds a new peripheral device: Adding ADC to STM32 .
Vinicoder
source share