cancel
Showing results for 
Search instead for 
Did you mean: 

TF-A boot only can handle 2 GB RAM? Does Op-tee or other TF-A DT causing this?

DMårt
Lead

I have a STM32MP257F custom board with a MT53E1G32D2FW-046 WT:C (4GB) memory.

But when I'm booting the TF-A, then I get this message. Notice that this processor passes the DDR data(stm32mp_ddr_test_data_bus(void)) and DDR rw(stm32mp_ddr_test_rw_access(void)) test! So I don't think that the assembly was bad.

ERROR:   DDR addr bus test: can't access memory @ 0x100000000
BACKTRACE: START: stm32mp2_ddr_setup

This means that my CPU cannot access the address 0x100000000. This limit is exactly 4GB.

If we looking at the code. That means that the offset variable must be 0x80000000, which is 2GB. The function stm32mp_ddr_test_addr_bus(size_t size) is beging called with size = 4294967296 = 4GB.

uintptr_t stm32mp_ddr_test_addr_bus(size_t size)
{
	size_t addressmask = size - 1U;
	size_t offset;
	size_t testoffset = 0U;

	/* Write the default pattern at each of the power-of-two offsets. */
	for (offset = sizeof(u_register_t); (offset & addressmask) != 0U;
	     offset <<= 1U) {
		mmio_write_pattern(STM32MP_DDR_BASE + offset, DDR_PATTERN);
	}

	/* Check for address bits stuck high. */
	mmio_write_pattern(STM32MP_DDR_BASE + testoffset, DDR_ANTIPATTERN);

	for (offset = sizeof(u_register_t); (offset & addressmask) != 0U;
	     offset <<= 1U) {
		if (mmio_read_pattern(STM32MP_DDR_BASE + offset) != DDR_PATTERN) {
			return STM32MP_DDR_BASE + offset;
		}
	}

I'm using the TF-A tree:

/dts-v1/;

#include <dt-bindings/pinctrl/stm32-pinfunc.h>
#include <dt-bindings/clock/stm32mp25-clksrc.h>
#include "stm32mp25-mx.dtsi"

#include "stm32mp257.dtsi"
#include "stm32mp25xf.dtsi"
#include "stm32mp257f-firmware-mx-rcc.dtsi"
#include "stm32mp25xxak-pinctrl.dtsi"
/*#include "stm32mp25-ddr.dtsi"*/

/* USER CODE BEGIN includes */
include "stm32mp25-lpddr4-1x32Gbits-1x32bits-1200MHz.dtsi"
/* USER CODE END includes */

/ {
	model = "STMicroelectronics custom STM32CubeMX board - openstlinux-6.6-yocto-scarthgap-mpu-v25.06.11";
	compatible = "st,stm32mp257f-firmware-mx", "st,stm32mp257";

	memory@80000000 {
		device_type = "memory";
		reg = <0x0 0x80000000 0x00000001 0x00000000>;

		/* USER CODE BEGIN memory */
		/* USER CODE END memory */
	};

	/* USER CODE BEGIN root */
	
	aliases{
		serial0 = &usart6;
	};

	chosen{
		stdout-path = "serial0:115200n8";
	};
	
	/* USER CODE END root */

}; /*root*/

 Questions:

  1. Does Op-tee causing this issue?
  2. Can I use a different memory setup in the tf-a device tree? For example:
memory@80000000 {
    device_type = "memory";
    reg = <0x0 0x80000000 0x0 0x80000000>; // första 2 GB
};

memory@100000000 {
    device_type = "memory";
    reg = <0x1 0x00000000 0x0 0x80000000>; // andra 2 GB
};​

3. Other solution?

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

STM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer
3 REPLIES 3
PatrickF
ST Employee

Hi,

We did not have such message on our DK board having exactly same memory.

Warning, Micron device revision must be C.

PatrickF_0-1771000753206.png

The B will not work as it is a dual rank which is not supported by STM32MP25 (might explain why half of the memory is not accessible).

 

I'm not expert on SW, but you might not need to touch what is working on Starter Package.

Did you you use same .dtsi file and same PCB interconnections than our STM32MP257F-DK board ?

Running https://wiki.st.com/stm32mpu/wiki/STM32DDRFW-UTIL could help to identify more precisely the issue.

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Tip of the day: Try Sidekick STM32 AI agent, see here

@PatrickF 

Hi! Yes. I know that the :C version of the LPDDR4 is very important.

I bought my MT53E1G32D2FW-046 WT:C memory from https://www.aliexpress.com/item/1005009146059053.html

When it was cheap! Around 20 USD each. Because the MT53E1G32D2FW-046 WT:C could not be bought from Mouser, DigiKey, LCSC etc..

I will try that software you recommending!

By the way! If my LPDDR memory is a :B version, it still works right? I mean, I can still have at least the half of the size working?

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

STM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer
DMårt
Lead

Hi @PatrickF 

I just want to give you a reply so you and the ST Dev team can understand the "solution".

First I changed from 16-Bit density (4 GB RAM) to 8-Bit density (2 GB RAM) and it's working.

INFO:    Memory size = 0x80000000 (2048 MB)

DMrt_0-1771179677187.png

 

My question for you is: Assuming that I bought a MT53E1G32D2FW-046 WT:B memory and I can only use the half of the density....is it possible to modify the TF-A software etc so I can use its fully density? 

The reason why I'm asking this is because the MT53E1G32D2FW-046 WT:C is expensive and MT53E1G32D2FW-046 WT:B is not expensive. I think there is a lack of large RAM options for the ST-solutions. I want at least have 4 GB on my STMP2 computer.

 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

STM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer