diff -u -r light-stm32f4/gnat/s-bbbopa.ads light-stm32f401/gnat/s-bbbopa.ads --- light-stm32f4/gnat/s-bbbopa.ads 2022-09-29 14:17:39.819434400 +0300 +++ light-stm32f401/gnat/s-bbbopa.ads 2024-03-12 17:11:52.584980267 +0300 @@ -42,16 +42,14 @@ -- Hardware clock -- -------------------- - Main_Clock_Frequency : constant := 168_000_000; - -- Optimal frequency of the system clock. Note that the STM32F411 can go - -- up to 200 MHz, but all other STM32F40x and STM32F41x MCUs can only do - -- 168 MHz. + Main_Clock_Frequency : constant := 84_000_000; + -- The STM32F401 unlike others can go up to 84 MHz only. - HSE_Clock_Frequency : constant := 8_000_000; - -- Frequency of High Speed External clock. + HSE_Clock_Frequency : constant := 25_000_000; + -- Frequency of High Speed External clock (As in "black pill"). FLASH_Latency : constant := 5; - PLLP_Value : constant := 2; + PLLP_Value : constant := 4; PLLQ_Value : constant := 7; end System.BB.Board_Parameters; diff -u -r light-stm32f4/gnat/start-rom.S light-stm32f401/gnat/start-rom.S --- light-stm32f4/gnat/start-rom.S 2022-09-29 14:17:39.819434400 +0300 +++ light-stm32f401/gnat/start-rom.S 2024-03-12 18:21:55.981719375 +0300 @@ -61,18 +61,6 @@ subs r1,r1,#1 bne 0b 1: - /* Copy .ccmdata */ - movw r0,#:lower16:__ccmdata_start - movt r0,#:upper16:__ccmdata_start - movw r1,#:lower16:__ccmdata_words - movw r2,#:lower16:__ccmdata_load - movt r2,#:upper16:__ccmdata_load - cbz r1,1f -0: ldr r4,[r2],#4 - str r4,[r0],#4 - subs r1,r1,#1 - bne 0b -1: /* Clear .bss */ movw r0,#:lower16:__bss_start movt r0,#:upper16:__bss_start diff -u -r light-stm32f4/ld/common-RAM.ld light-stm32f401/ld/common-RAM.ld --- light-stm32f4/ld/common-RAM.ld 2022-09-29 14:17:39.819434400 +0300 +++ light-stm32f401/ld/common-RAM.ld 2024-03-12 18:20:57.248385024 +0300 @@ -87,20 +87,6 @@ __data_end = .; } > sram_da - .ccmdata : - { - __ccmdata_start = .; - *(.ccmdata .ccmdata.*) - - /* Ensure that the end of the data section is always word aligned. - Initial values are stored in 4-bytes blocks so we must guarantee - that these blocks do not fall out the section (otherwise they are - truncated and the initial data for the last block are lost). */ - - . = ALIGN(0x4); - __ccmdata_end = .; - } > ccm_da - .bss (NOLOAD): { . = ALIGN(0x8); __bss_start = .; diff -u -r light-stm32f4/ld/common-ROM.ld light-stm32f401/ld/common-ROM.ld --- light-stm32f4/ld/common-ROM.ld 2022-09-29 14:17:39.819434400 +0300 +++ light-stm32f401/ld/common-ROM.ld 2024-03-12 18:20:07.011717499 +0300 @@ -90,22 +90,6 @@ } > sram_da __data_words = (__data_end - __data_start) >> 2; - __ccmdata_load = __rom_end + (__data_words << 2); - .ccmdata : AT (__ccmdata_load) - { - __ccmdata_start = .; - *(.ccmdata .ccmdata.*) - - /* Ensure that the end of the data section is always word aligned. - Initial values are stored in 4-bytes blocks so we must guarantee - that these blocks do not fall out the section (otherwise they are - truncated and the initial data for the last block are lost). */ - - . = ALIGN(0x4); - __ccmdata_end = .; - } > ccm_da - __ccmdata_words = (__ccmdata_end - __ccmdata_start) >> 2; - .bss (NOLOAD): { . = ALIGN(0x8); __bss_start = .; diff -u -r light-stm32f4/ld/memory-map.ld light-stm32f401/ld/memory-map.ld --- light-stm32f4/ld/memory-map.ld 2022-09-29 14:17:39.823434400 +0300 +++ light-stm32f401/ld/memory-map.ld 2024-03-12 18:28:51.885059907 +0300 @@ -36,13 +36,11 @@ MEMORY { - flash (rx) : ORIGIN = 0x08000000, LENGTH = 1024K - sram12 (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - ccm (rw) : ORIGIN = 0x10000000, LENGTH = 64K + flash (rx) : ORIGIN = 0x08000000, LENGTH = 256K + sram12 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K } REGION_ALIAS("sram_tx", sram12) REGION_ALIAS("sram_ro", sram12) REGION_ALIAS("sram_bs", sram12) REGION_ALIAS("sram_da", sram12) -REGION_ALIAS("ccm_da", ccm)