If the UART_2 resource is moved to U-Boot/Linux (Partition 6) in SCFW, the kernel fails to boot.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

If the UART_2 resource is moved to U-Boot/Linux (Partition 6) in SCFW, the kernel fails to boot.

跳至解决方案
696 次查看
MasakiHayakawa
Contributor III

Hi,

 

We have created a custom board with the i.MX8QM. Currently, we are evaluating it using an evaluation board (i.MX8QM MEK) until the custom board is ready. We are using BSP version LF6.6.3_1.0.0, so we are using SCFW version 1.15.0.

On the custom board, Linux controls UART_2. The pin configuration is as follows:
UART0_RTS_B - UART2_RX
UART0_CTS_B - UART2_TX

Therefore, we moved the resource allocated to M4_1 (Partition 4) to U-Boot/Linux (Partition 6) in SCFW. The changes in SCFW are as follows:
diff --git a/platform/board/mx8qm_mek/board.c b/platform/board/mx8qm_mek/board.c
index dfabbdb..b866696 100755
--- a/platform/board/mx8qm_mek/board.c
+++ b/platform/board/mx8qm_mek/board.c
@@ -916,10 +916,9 @@ void board_system_config(sc_bool_t early, sc_rm_pt_t pt_boot)
sc_rm_mr_t mr;

/* List of resources */
- static const sc_rsrc_t rsrc_list[9U] =
+ static const sc_rsrc_t rsrc_list[8U] =
{
SC_R_IRQSTR_M4_1,
- SC_R_UART_2,
SC_R_MU_6B,
SC_R_MU_7B,
SC_R_MU_9B,
@@ -929,10 +928,9 @@ void board_system_config(sc_bool_t early, sc_rm_pt_t pt_boot)
};

/* List of pads */
- static const sc_pad_t pad_list[8U] =
+ static const sc_pad_t pad_list[6U] =
{
RM_RANGE(SC_P_M41_I2C0_SCL, SC_P_M41_GPIO0_01),
- RM_RANGE(SC_P_UART0_CTS_B, SC_P_UART0_RTS_B),
RM_RANGE(SC_P_FLEXCAN0_RX, SC_P_FLEXCAN2_TX),
RM_RANGE(SC_P_QSPI0A_DATA0, SC_P_COMP_CTL_GPIO_1V8_3V3_QSPI0)
};

When using flash.bin (flash_linux_m4) which includes the modified scfw_tcm.bin, the kernel fails to boot with an error during startup.

I am attaching the kernel boot log from that time.

Do you have any ideas on what could be causing this?

0 项奖励
回复
1 解答
632 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

For the m4_1_image.bin in imx-boot, it's SDK_2_9_0_MEK-MIMX8QM\boards\mekmimx8qm\multicore_examples\rpmsg_lite_pingpong_rtos

You need comment BOARD_InitDebugConsole function in SDK which will use LPUART2 in M core.

在原帖中查看解决方案

0 项奖励
回复
4 回复数
680 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @MasakiHayakawa 

You need modify Mcore firmware which may still use uart0 resource.


Best Regards
Zhiming

0 项奖励
回复
665 次查看
MasakiHayakawa
Contributor III

Hi Zhiming_Liu

Thank you for your response.

Is there a source code for the Mcore firmware?
I would like to confirm if UART2 is being used.

Best regards

0 项奖励
回复
633 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

For the m4_1_image.bin in imx-boot, it's SDK_2_9_0_MEK-MIMX8QM\boards\mekmimx8qm\multicore_examples\rpmsg_lite_pingpong_rtos

You need comment BOARD_InitDebugConsole function in SDK which will use LPUART2 in M core.

0 项奖励
回复
608 次查看
MasakiHayakawa
Contributor III

Hi Zhiming_Liu

Thank you for your response.

We deleted the LPUART2 source code and created the M4_1 binary file using the following toolchain and SDK:

  • gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2
  • SDK_2_9_0_MEK-MIMX8QM.tar.gz

We then replaced it with the created M4_1 binary file to generate flash.bin (flash_linux_m4) and confirmed its operation. As a result, the kernel boot was successful.

Thank you very much.

he steps to build the M4_1 binary file are as follows:
$ sudo apt-get install cmake
$ export ARMGCC_DIR=~/gcc-arm-none-eabi-9-2020-q2-update
$ cd boards/mekmimx8qm/demo_apps/power_mode_switch/cm4_core1/armgcc
$ ./build_all.sh

We renamed the following built binary to m4_1_image.bin, copied it to the iMX8QM folder of imx-boot, and created flash.bin (flash_linux_m4):
$ ls -l release/power_mode_switch_m41.bin

We are attaching the patch that disables LPUART2.

0 项奖励
回复