2025-07-18 3:40 AM - edited 2025-07-18 3:52 AM
Hi everybody,
I'm using a custom PCB which is build upon a STM32L431CBT6 MCU. When connecting to the CUBE Programmer i had this error:
Error: Database: There's no active configuration for this device. All the 1 configurations are disabled!
Then, i confirmed the issue arose from the DeviceID 0x435 .xml file not having the 128K flash memory settings. What i did is code it myself like this:
<!-- JTAG_SWD Interface -->
<Interface name="JTAG_SWD">
<Configuration number="0x0">
<!-- 256KB-->
<FlashSize>
<ReadRegister address="0x1FFF75E0" mask="0x0000FFFF" value="0x0100"/>
</FlashSize>
</Configuration>
<Configuration number="0x1">
<!-- 128KB-->
<FlashSize>
<ReadRegister address="0x1FFF75E0" mask="0x0000FFFF" value="0x0080"/>
</FlashSize>
</Configuration>
</Interface>
<!-- Bootloader Interface -->
<Interface name="Bootloader">
<Configuration number="0x0">
</Configuration>
</Interface>
</Configurations>
<!-- Peripherals -->
<Peripherals>
<!-- Embedded SRAM -->
<Peripheral>
<Name>Embedded SRAM</Name>
<Type>Storage</Type>
<Description/>
<ErasedValue>0x00</ErasedValue>
<Access>RWE</Access>
<!-- 128 KB -->
<Configuration>
<Parameters address="0x20000000" name="SRAM" size="0xC000"/>
<Description/>
<Organization>Single</Organization>
<Bank name="Bank 1">
<Field>
<Parameters address="0x20000000" name="SRAM" occurrence="0x1" size="0xC000"/>
</Field>
</Bank>
</Configuration>
</Peripheral>
<!-- Embedded Flash -->
<Peripheral>
<Name>Embedded Flash</Name>
<Type>Storage</Type>
<Description>The Flash memory interface manages CPU AHB I-Code and D-Code accesses to the Flash memory. It implements the erase and program Flash memory operations and the read and write protection mechanisms</Description>
<ErasedValue>0xFF</ErasedValue>
<Access>RWE</Access>
<FlashSize address="0x1FFF75E0" default="0x40000"/>
<BootloaderVersion address="0x1FFF6FFE"/>
<!-- 128KB-->
<Configuration>
<Parameters address="0x08000000" name=" 128 Kbytes Embedded Flash" size="0x20000"/>
<Description/>
<Organization>Single</Organization>
<Alignment>0x8</Alignment>
<Bank name="Bank 1">
<Field>
<Parameters address="0x08000000" name="sector0" occurrence="0x40" size="0x800"/>
</Field>
</Bank>
</Configuration>
<!-- 256KB-->
<Configuration>
<Parameters address="0x08000000" name=" 256 Kbytes Embedded Flash" size="0x40000"/>
<Description/>
<Organization>Single</Organization>
<Alignment>0x8</Alignment>
<Bank name="Bank 1">
<Field>
<Parameters address="0x08000000" name="sector0" occurrence="0x80" size="0x800"/>
</Field>
</Bank>
</Configuration>
</Peripheral>
This fixed my CubeProgrammer connection issues, which now was only reading the correct 128KB from flash memory, but didn't fix the main error when debugging in CubeIde:
Break at address "0x1fff3f36" with no debug information available, or outside of program code.
Things i checked and errors happening:
- My linker script (.ld file) is correct and specifies 128KB of flash.
- Code may run sometimes without issues and SWV Console working, but then it gets broken somehow.
- When using .s as startup file Reset_Handler is not always mapped properly since im unable to reset the code execution once run. Swaping to .S made the Reset_Hanlder mapping proper but still had the break at address issue.
- I updated the file in the CubIde Programmer Data_Base folder too, as i did with CubeProgrammer.
- I saw this post "Error: Database: There's no active configuration for this device" which handled the same issue, which was solved in an updated CubeProgrammer version, i guess for my current MCU this still needs to be handled too.
- When CubeProgrammer was misreading 256K of flash memory, i performed a full chip erase once... Could this be problematic?
I'm starting at embedded system development and still don't know the ins and outs deeply of .Id .s and .o files when compiling or going into debug mode, can anybody point me to a direction of how can i fix this problem? I can provide further information, just ask. (I attached the relevant files)
Thank you for your time!