Apalis i.MX8QM SCFW Debug Monitor

I am currently working on some customizations to the System Controller Firmware and I wanted to debug it using the SCFW Debug Monitor Feature. I am using the imx-scfw-porting-kit-1.14.0.

When I try to make the scfw using

make clean; make SOC=MX8QM B=apalis DL=3 R=b0 M=1 qm

I get the following Error:

../arm-none-eabi/bin/ld: build_mx8qm_b0/scfw_tcm.elf section `.rodata' will not fit in region `m_text'
../arm-none-eabi/bin/ld: region m_text overflowed with initialized data
../arm-none-eabi/bin/ld: section .emul VMA [000000002000fff0,000000002000ffff] overlaps section .rodata VMA [0000000020007b98,0000000020012547]
../arm-none-eabi/bin/ld: section .fini_array VMA [0000000020012548,000000002001257f] overlaps section .bss VMA [0000000020010280,000000002001a9ff]
../arm-none-eabi/bin/ld: region `m_text' overflowed by 9616 bytes

I have tried to tinker around with the linker script, allowing the m_text section some more space, doing so the board doesn’t seem to boot anymore.

Is there a fix for this issue?

1 Like

Hi @silken !

Sorry for the delay.

I managed to reproduce the compilation issue.

Also, I tried to enable the Debug Monitor for the default board (board_common) and the compilation issue doesn’t occur:

 $ make clean; make SOC=MX8QM R=b0 U=2 M=1 qm
Compiling platform/drivers/pmic/fsl_pmic.c
Compiling platform/drivers/pmic/pf100/fsl_pf100.c
Compiling platform/drivers/pmic/pf8100/fsl_pf8100.c
Compiling platform/board/mx8qm_val/board.c
Compiling platform/board/board_common.c
Compiling platform/board/pmic.c
Assembling platform/board/board.S
Compiling platform/svc/irq/svc.c
Compiling platform/svc/misc/svc.c
Compiling platform/svc/pad/svc.c
Compiling platform/svc/pm/svc.c
Compiling platform/svc/rm/svc.c
Compiling platform/svc/seco/svc.c
Compiling platform/svc/timer/svc.c
Compiling platform/svc/irq/rpc_srv.c
Compiling platform/svc/misc/rpc_srv.c
Compiling platform/svc/pad/rpc_srv.c
Compiling platform/svc/pm/rpc_srv.c
Compiling platform/svc/rm/rpc_srv.c
Compiling platform/svc/seco/rpc_srv.c
Compiling platform/svc/timer/rpc_srv.c
Compiling platform/svc/irq/rpc_clnt.c
Compiling platform/svc/misc/rpc_clnt.c
Compiling platform/svc/pad/rpc_clnt.c
Compiling platform/svc/pm/rpc_clnt.c
Compiling platform/svc/rm/rpc_clnt.c
Compiling platform/svc/seco/rpc_clnt.c
Compiling platform/svc/timer/rpc_clnt.c
Linking build_mx8qm_b0/scfw_tcm.elf ....
Objcopy build_mx8qm_b0/scfw_tcm.bin ....
done.

Out of curiosity, it works for board Colibri iMX8X

 $ make clean; make SOC=MX8QX B=colibri R=b0 U=2 M=1 qx
Generating platform/board/mx8qx_colibri/dcd/imx8x_ramid2_dcd_1.2GHz.h
Generating platform/board/mx8qx_colibri/dcd/imx8x_ramid3_dcd_1.2GHz.h
Generating platform/board/mx8qx_colibri/dcd/imx8x_ramid2_dcd_1.2GHz_retention.h
Generating platform/board/mx8qx_colibri/dcd/imx8x_ramid3_dcd_1.2GHz_retention.h
Compiling platform/drivers/pmic/fsl_pmic.c
Compiling platform/drivers/pmic/pf8100/fsl_pf8100.c
Compiling platform/drivers/pmic/pf100/fsl_pf100.c
Compiling platform/board/mx8qx_colibri/board.c
Compiling platform/board/board_common.c
Assembling platform/board/board.S
Compiling platform/board/pmic.c
Compiling platform/svc/irq/svc.c
Compiling platform/svc/misc/svc.c
Compiling platform/svc/pad/svc.c
Compiling platform/svc/pm/svc.c
Compiling platform/svc/rm/svc.c
Compiling platform/svc/seco/svc.c
Compiling platform/svc/timer/svc.c
Compiling platform/svc/irq/rpc_srv.c
Compiling platform/svc/misc/rpc_srv.c
Compiling platform/svc/pad/rpc_srv.c
Compiling platform/svc/pm/rpc_srv.c
Compiling platform/svc/rm/rpc_srv.c
Compiling platform/svc/seco/rpc_srv.c
Compiling platform/svc/timer/rpc_srv.c
Compiling platform/svc/irq/rpc_clnt.c
Compiling platform/svc/misc/rpc_clnt.c
Compiling platform/svc/pad/rpc_clnt.c
Compiling platform/svc/pm/rpc_clnt.c
Compiling platform/svc/rm/rpc_clnt.c
Compiling platform/svc/seco/rpc_clnt.c
Compiling platform/svc/timer/rpc_clnt.c
Linking build_mx8qx_b0/scfw_tcm.elf ....
Objcopy build_mx8qx_b0/scfw_tcm.bin ....
done.

I am not sure that tweaking the linker script is going to help. The System Controller Unit (SCU) has its memory and is of course limited. If the program with Debug Monitor disabled is already too big (se below), enabling it might be causing the overflow.

“Too big program” hypothesis

As a dumb test, I compiled with the Debug Monitor enabled and, to make the program smaller, I enabled the SKIP_DDR as well (reference: i.MX-System-Controller-Firmware/board.c at master · toradex/i.MX-System-Controller-Firmware · GitHub - check the following make command line) simply to make the program smalled. By doing this, I was able to compile it. I don’t know all the implications of using the SKIP_DDR, but I would guess that it renders the Apalis module unusable. This was just a dumb compilation test to check the “too big program” idea. As it was successfully compiled, I would say that this was confirmed:

 $ make clean; make SOC=MX8QM B=apalis R=b0 U=2 M=1 SKIP_DDR=1 qm
Compiling platform/drivers/pmic/fsl_pmic.c
Compiling platform/drivers/pmic/pf8100/fsl_pf8100.c
Compiling platform/drivers/pmic/pf100/fsl_pf100.c
Compiling platform/board/mx8qm_apalis/board.c
Compiling platform/board/board_common.c
Assembling platform/board/board.S
Compiling platform/board/pmic.c
Compiling platform/svc/irq/svc.c
Compiling platform/svc/misc/svc.c
Compiling platform/svc/pad/svc.c
Compiling platform/svc/pm/svc.c
Compiling platform/svc/rm/svc.c
Compiling platform/svc/seco/svc.c
Compiling platform/svc/timer/svc.c
Compiling platform/svc/irq/rpc_srv.c
Compiling platform/svc/misc/rpc_srv.c
Compiling platform/svc/pad/rpc_srv.c
Compiling platform/svc/pm/rpc_srv.c
Compiling platform/svc/rm/rpc_srv.c
Compiling platform/svc/seco/rpc_srv.c
Compiling platform/svc/timer/rpc_srv.c
Compiling platform/svc/irq/rpc_clnt.c
Compiling platform/svc/misc/rpc_clnt.c
Compiling platform/svc/pad/rpc_clnt.c
Compiling platform/svc/pm/rpc_clnt.c
Compiling platform/svc/rm/rpc_clnt.c
Compiling platform/svc/seco/rpc_clnt.c
Compiling platform/svc/timer/rpc_clnt.c
Linking build_mx8qm_b0/scfw_tcm.elf ....
Objcopy build_mx8qm_b0/scfw_tcm.bin ....
done.

Therefore, I don’t know if there is anything that can be done regarding this… Double checking the SCU memory size and making the most out of it would be a possibility :thinking:

I am still checking internally.


A very important question: could you please explain your use case and why you need to enable such a feature in SCFW? Maybe we can think of another (perhaps easier approach)?

Best regards,

Hi @silken !

Do you have any updates regarding this issue?

Best regards,

Hi @henrique.tx ,

I’m sorry for coming back to you this late. Thank you a lot for looking into this issue.
The main reason for this was simply curiosity and seeing what we could do with the Debug Monitor. I have not been able to compile the debug monitor into the SCFW, even with dropping lots of functions. I think I have exceeded the time well spent on this matter but thank you anyways!

Best regards

Hi @silken

Thanks for the feedback.

Have a nice day!

Best regards,