Outils pour utilisateurs

Outils du site


francois:stm32f405_minipix_zephyr

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
francois:stm32f405_minipix_zephyr [2024/11/24 09:00] – créée francoisfrancois:stm32f405_minipix_zephyr [2024/12/17 16:10] (Version actuelle) – [MCUboot] francois
Ligne 25: Ligne 25:
 mettre à jour l'appli comme on veut. mettre à jour l'appli comme on veut.
  
-Il faut rajouter les fichier+Il faut rajouter les paramètres suivants dans le fichier ''zephyr/boards/radiolink/mini_pix/radiolink_mini_pix_defconfig''
  
-==== Changement de la fréquence ====+<code> 
 +CONFIG_CLOCK_STM32_HSE_CLOCK=24000000
  
-AC+# enable MCUBoot 
 +CONFIG_BOOTLOADER_MCUBOOT=y 
 +CONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE=y 
 +CONFIG_MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY=y 
 +</code> 
 + 
 +Il faut modifier le device tree ''zephyr/boards/radiolink/mini_pix/radiolink_mini_pix.dts'' 
 + 
 +Changement de l'include du µC 
 +<code> 
 +[...] 
 +#include <st/f4/stm32f405vgtx-pinctrl.dtsi> 
 +[...] 
 +</code> 
 + 
 +Les partitions 
 +<code> 
 +[...] 
 + soc { 
 + flash-controller@40023c00 { 
 + flash0: flash@8000000 { 
 + partitions { 
 + compatible = "fixed-partitions"; 
 + #address-cells = <0x1>; 
 + #size-cells = <0x1>; 
 + 
 + boot_partition: partition@0 { 
 + reg = <0x0 0x10000>; 
 + read-only; 
 + }; 
 + storage_partition: partition@1e000 { 
 + reg = <0x1e000 0x2000>; 
 + }; 
 + slot0_partition: partition@20000 { 
 + reg = <0x20000 0x60000>; 
 + }; 
 + slot1_partition: partition@80000 { 
 + reg = <0x80000 0x60000>; 
 + }; 
 + scratch_partition: partition@e0000 { 
 + reg = <0xe0000 0x20000>; 
 + }; 
 + }; 
 + 
 + }; 
 + }; 
 + }; 
 +[...] 
 +</code> 
 + 
 +Dire sur quelle partition le code sera et quelle sera la console 
 + 
 +<code> 
 +[...] 
 + chosen { 
 + zephyr,console = &usart2; 
 + zephyr,shell-uart = &usart2; 
 + zephyr,sram = &sram0; 
 + zephyr,flash = &flash0; 
 + zephyr,code-partition = &slot0_partition; 
 + zephyr,ccm = &ccm0; 
 + }; 
 +[...] 
 +</code> 
 + 
 +Changement de la fréquence 
 + 
 +<code> 
 +[...] 
 +&clk_hse { 
 + clock-frequency = <DT_FREQ_M(24)>; 
 + status = "okay"; 
 +}; 
 + 
 +&pll { 
 + div-m = <24>; 
 + mul-n = <336>; 
 + div-p = <2>; 
 + div-q = <7>; 
 + clocks = <&clk_hse>; 
 + status = "okay"; 
 +}; 
 + 
 +&rcc { 
 + clocks = <&pll>; 
 + clock-frequency = <DT_FREQ_M(168)>; 
 + ahb-prescaler = <1>; 
 + apb1-prescaler = <4>; 
 + apb2-prescaler = <2>; 
 +}; 
 + 
 +[...] 
 +</code> 
 + 
 +les leds 
 + 
 +<code> 
 +[...] 
 + leds: leds { 
 + compatible = "gpio-leds"; 
 + led: led_0 { 
 + gpios = <&gpioc 5 GPIO_ACTIVE_HIGH>; 
 + label = "User LED"; 
 + }; 
 + boot_led: led_1 { 
 + gpios = <&gpiob 1 GPIO_ACTIVE_HIGH>; 
 + label = "Bootloader LED"; 
 + }; 
 + 
 + }; 
 +[...] 
 +</code> 
 + 
 +le port série 
 + 
 +<code> 
 +[...] 
 +&usart2 { 
 + pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pd6>; 
 + pinctrl-names = "default"; 
 + current-speed = <115200>; 
 + status = "okay"; 
 +}; 
 +[...] 
 +</code>
  
 ===== MCUboot ===== ===== MCUboot =====
Ligne 40: Ligne 165:
  
   west build -t menuconfig   west build -t menuconfig
 +
 +Il faut configurer les trucs suivants:
 +
 +  # Configured to only overwrite slot 0
 +  CONFIG_SINGLE_APPLICATION_SLOT=y
 +
 +  CONFIG_BOOT_USB_DFU_WAIT=y
 +  # CONFIG_BOOT_USB_DFU_GPIO is not set
 +  CONFIG_BOOT_USB_DFU_WAIT_DELAY_MS=12000
 +  CONFIG_BOOT_USB_DFU_NO_APPLICATION=y
 +  CONFIG_MCUBOOT_INDICATION_LED=y
 +  CONFIG_USB_DEVICE_DRIVER=y
 +  CONFIG_USB_DEVICE_VID=0x0483
 +  CONFIG_USB_DEVICE_PID=0xdf11
 +  CONFIG_USB_DEVICE_MANUFACTURER="FOUE"
 +==== Flasher MCUboot ====
 +
 +Il faut passer en mode DFU sur la Mini-Pix en mettant la pin 94 (BOOT0) à 3.3V.
 +
 +Ensuite, dans ''zephyr/bootloader/mcuboot/boot/zephyr/build/zephyr''
 +
 +  dfu-util -a 0 -s 0x08000000:leave -D zephyr.bin
francois/stm32f405_minipix_zephyr.1732438847.txt.gz · Dernière modification : de francois

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki