name = "embedded_stm32g4xx" description = "embedded runtime for the STM32G4XX SoC" version = "15.4.0" long-description = """ ## Usage First edit your `alire.toml` file and add the following elements: - Add `embedded_stm32g4xx` in the dependency list: ```toml [[depends-on]] embedded_stm32g4xx = "*" ``` - if applicable, apply any runtime configuration variables (see below). Then edit your project file to add the following elements: - "with" the run-time project files. With this, gprbuild will compile the run-time before your application ```ada with "runtime_build.gpr"; with "ravenscar_build.gpr"; ``` - Specify the `Target` and `Runtime` attributes: ```ada for Target use runtime_build'Target; for Runtime ("Ada") use runtime_build'Runtime ("Ada"); ``` - specify the `Linker` switches: ```ada package Linker is for Switches ("Ada") use Runtime_Build.Linker_Switches; end Linker; ``` The runtime is configurable via Alire crate configuration variables. See the project website for full details of the available options. By default, the runtime is configured for the STM32G474RE. If you are using a different MCU, then you will need to configure the runtime by adding the following to your `alire.toml`. For example, to configure the runtime for the STM32G431K6: ```toml [configuration.values] embedded_stm32g4xx.MCU_Sub_Family = "G431" embedded_stm32g4xx.MCU_Flash_Memory_Size = "6" ``` By default, the runtime configures the clock tree for a 170 MHz system clock from the high-speed internal (HSI) oscillator. If you want a different clock configuration, then use the crate configuration variables to specify the configuration you wish to use. For example, to configure the runtime to generate a 170 MHz system clock from a 24 MHz HSE crystal oscillator: ```toml [configuration.values] # Configure a 24 MHz HSE crystal oscillator embedded_stm32g4xx.HSE_Clock_Frequency = 24000000 embedded_stm32g4xx.HSE_Bypass = false # Select PLLRCLK as the SYSCLK source embedded_stm32g4xx.SYSCLK_Src = "PLLRCLK" # Configure the PLL VCO to run at 340 MHz from the 24 MHz HSE (fVCO = fHSE * (N/M)) embedded_stm32g4xx.PLL_Src = "HSE" embedded_stm32g4xx.PLL_N_Mul = 85 embedded_stm32g4xx.PLL_M_Div = 6 # Configure the PLLRCLK to run at 170 MHz from the 340 MHz VCO. embedded_stm32g4xx.PLL_R_Div = 2 # Configure the AHB and APB to also run at 170 MHz embedded_stm32g4xx.AHB_Pre = "DIV1" embedded_stm32g4xx.APB1_Pre = "DIV1" embedded_stm32g4xx.APB2_Pre = "DIV1" ``` The runtime will generate a compile time error when an invalid PLL configuration is set. By default the PLL's Q and P clocks are enabled. If you don't need them, then you can disable them via the crate configuration: ```toml [configuration.values] embedded_stm32g4xx.PLL_Q_Enable = false embedded_stm32g4xx.PLL_P_Enable = false ``` The runtime will enable the PLL only when either `PLL_Q_Enable` or `PLL_P_Enable` is `true`, or when `SYSCLK_Src = "PLLRCLK"`. The interrupt stack sizes are also configurable: ```toml [configuration.values] embedded_stm32g4xx.Interrupt_Stack_Size = 1024 embedded_stm32g4xx.Interrupt_Secondary_Stack_Size = 128 ``` """ authors = ["AdaCore", "Daniel King"] maintainers = ["Daniel King "] maintainers-logins = ["damaki"] licenses = "GPL-3.0-or-later WITH GCC-exception-3.1" tags = ["embedded", "runtime", "stm32g4"] website = "https://github.com/damaki/community-bb-runtimes" project-files = ['runtime_build.gpr', 'ravenscar_build.gpr'] [configuration] generate_c = false output_dir = "gnat_user" [configuration.variables] MCU_Sub_Family = { type = "Enum", values = ["G431", "G441", "G491", "G4A1", "G473", "G483", "G474", "G484"], default = "G474" } MCU_Flash_Memory_Size = { type = "String", default = "E" } LSI_Enabled = { type = "Boolean", default = true } LSE_Enabled = { type = "Boolean", default = false } LSE_Bypass = { type = "Boolean", default = false } HSE_Bypass = { type = "Boolean", default = false } HSE_Clock_Frequency = { type = "Integer", first = 4000000, last = 48000000, default = 24000000 } PLL_Src = { type = "Enum", values = ["HSE", "HSI16"], default = "HSI16" } PLL_M_Div = { type = "Integer", first = 1, last = 16, default = 4 } PLL_N_Mul = { type = "Integer", first = 8, last = 127, default = 85 } PLL_R_Div = { type = "Enum", values = ["DIV2", "DIV4", "DIV6", "DIV8"], default = "DIV2" } PLL_Q_Div = { type = "Enum", values = ["DIV2", "DIV4", "DIV6", "DIV8"], default = "DIV2" } PLL_P_Div = { type = "Integer", first = 2, last = 31, default = 2 } PLL_Q_Enable = { type = "Boolean", default = true } PLL_P_Enable = { type = "Boolean", default = true } SYSCLK_Src = { type = "Enum", values = ["HSI16", "HSE", "PLLRCLK"], default = "PLLRCLK" } AHB_Pre = { type = "Enum", values = ["DIV1", "DIV2", "DIV4", "DIV8", "DIV16", "DIV64", "DIV128", "DIV256", "DIV512"], default = "DIV1" } APB1_Pre = { type = "Enum", values = ["DIV1", "DIV2", "DIV4", "DIV8", "DIV16"], default = "DIV1" } APB2_Pre = { type = "Enum", values = ["DIV1", "DIV2", "DIV4", "DIV8", "DIV16"], default = "DIV1" } Interrupt_Stack_Size = { type = "Integer", first = 1, default = 1024 } Interrupt_Secondary_Stack_Size = { type = "Integer", first = 1, default = 128 } [[depends-on]] gnat_arm_elf = "^15" [origin] hashes = [ "sha256:b4fd8e5467dcd0737b0e7f2facce319dd0b181f36f7d7c7cb3ee51359f0f3e8c", "sha512:64c4ec0d6b631e37fe8fba2ed5a31e37f45fea0adf537aabb23097d2ae1a146fa687f41fbe7c426f7f5cd19cc789bb7df6e22516bc6b53eb75195d2f362c5141", ] url = "https://github.com/damaki/community-bb-runtimes/releases/download/v15.4.0/embedded-stm32g4xx-15.4.0.tar.gz"