Registered User No edit summary |
Registered User mNo edit summary Tag: 2017 source edit |
||
(46 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
< | <noinclude>{{ApplicableFor | ||
|MPUs list=STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | |||
|MPUs checklist=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | |||
}}</noinclude> | |||
If your issue is not listed, try looking | {{TrustedDomainApplicability | TDflavor = M33-TD| applicable = no}} | ||
<onlyinclude> | |||
Some typical issues related to the management of a Cortex-M coprocessor are listed below. Solutions or debugging methods are proposed for these issues. | |||
If your issue is not listed, try looking in the articles in the [[:Category:Coprocessor management Linux| Coprocessor management Linux]], [[:Category:Coprocessor management STM32Cube | Coprocessor management STM32Cube]] or [[:Category:Troubleshooting grids|troubleshooting grids]] categories. | |||
== | == Cortex-M coprocessor firmware loading and control == | ||
{{:Troubleshooting grid table template}} | {{:Troubleshooting grid table template}} | ||
<onlyinclude> | <onlyinclude> | ||
<includeonly> | <includeonly> | ||
! colspan="2" | coprocessor | ! colspan="2" | Cortex-M coprocessor firmware loading and control | ||
|- | |- | ||
</includeonly> | </includeonly> | ||
| | | | ||
The coprocessor traces are not available on | The coprocessor traces are not available on Linux<sup>®</sup> side | ||
{{Board$}} cat /sys/kernel/debug/remoteproc/remoteproc0/trace0 | {{Board$}}cat /sys/kernel/debug/remoteproc/remoteproc0/trace0 | ||
No such file or directory | No such file or directory | ||
|| | || | ||
This may happen for two reasons: | This may happen for two reasons: | ||
* The firmware does not include any [[ | * The firmware does not include any [[Interprocessor communication – resource table|resource table]] or the resource table does not define any [[Interprocessor communication – resource table#How_to_add_trace_for_the_log_buffer_-28STM32MP15x_lines_only-29|trace]]. | ||
: Update the firmware resource table and rebuild the firmware | : Update the firmware resource table and rebuild the firmware | ||
* The ".resource_table" section is empty or not defined in the elf file. | * The ".resource_table" section is empty or not defined in the elf file. | ||
:Use following command to verify it in elf file | :Use the following command to verify it in the generated elf file: | ||
{{PC$}} readelf -l <elf file> | {{PC$}}readelf -l <elf file> | ||
... | ... | ||
02 .data .resource_table .bss ._user_heap_stack | 02 .data .resource_table .bss ._user_heap_stack | ||
Line 27: | Line 32: | ||
|- | |- | ||
| | | | ||
When starting the Cortex-M coprocessor from the bootloader (u-boot): | |||
"unsupported fw ver: 0 | "unsupported fw ver: 0 | ||
Remote Processor 0 resource table Not found : 0x00000000-0x0 " | Remote Processor 0 resource table Not found : 0x00000000-0x0 " | ||
|| | || | ||
The firmware does not include any [[ | The firmware does not include any [[Interprocessor communication – resource table|resource table]]. | ||
This is only a warning that | This is only a warning that does not prevent the firmware from starting properly. | ||
"rproc load_rsc" step can be bypassed | "rproc load_rsc" step can be bypassed. | ||
|- | |||
| | |||
When Loading a signed firmware from OP-TEE: | |||
"remoteproc remoteproc0: bad phdr da 0x80123db8 mem 0x7f36a8" | |||
|| | |||
There is probably a mismatch between the firmware memory mapping and the memory regions declared in the [[Linux_remoteproc_framework_overview#Device_tree_configuration | Linux remoteproc device tree]]. | |||
Use the following command to verify it in the generated elf file: | |||
{{PC$}}readelf -l <elf file> | |||
and compare the elf program header with the [[OP-TEE_remoteproc_framework_overview#Device_tree_configuration | OP-TEE device tree reserved-memory]] declaration. | |||
|- | |||
| | |||
When Loading a signed firmware from OP-TEE: | |||
"E/TA: remoteproc_load_segment:887 Fails to clear segment, res = 0xffff0001" | |||
|| | |||
There is probably a mismatch between the firmware memory mapping and the memory regions declared in the [[How to protect the Cortex-M coprocessor firmware#Device_tree_configuration | OP-TEE remoteproc device tree]]. | |||
Use the following command to verify it in the generated elf file: | |||
{{PC$}}readelf -l <elf file> | |||
and compare the elf program header with the [[OP-TEE_remoteproc_framework_overview#Device_tree_configuration | OP-TEE device tree reserved-memory]] declaration. | |||
|- | |||
| | |||
When Loading a signed firmware from OP-TEE: | |||
"E/TA: remoteproc_load_fw:1014 Can't Authenticate the firmware <res = 0xFFFF0000>" | |||
|| | |||
This means the OP-TEE remoteproc framework detect something not valid in the the firmware format. | |||
The root cause can be: | |||
* The firmware is a ELF while a signed image is required. Following format should return the '''TEE''' supported format: | |||
{{PC$}}cat sys/class/remoteproc/remoteproc0/fw_format | |||
* The firmware file is corrupted. | |||
* The firmware image(s) has(ve) not be signed. | |||
* The firmware image(s) has been signed with a bad key. | |||
* The TLV parameters are not valid. | |||
See [[How to protect the Cortex-M coprocessor firmware#Firmware_signature_2 | Firmware_signature]] for details<BR> | |||
To debug some traces can be added in {{CodeSource | OP-TEE_OS | ta/remoteproc/remoteproc_core.c}} | |||
|- | |||
| | |||
When Loading a ELF firmware from Linux on {{MicroprocessorDevice | device=2}}, there is no error but the Cortex-M33 does not start correctly. | |||
|| | |||
The boot address of the Cortex-M33 may be invalid. The Cortex-M33 boot address must correspond to the address of the Cortex-M33 interrupt vector table. To ensure the boot address is valid, follow these steps: | |||
* Enable the [[Linux_remoteproc_framework_overview#How_to_traceremoteproc debug traces | remoteproc linux driver debug traces]] to verify the boot address in linuxkernel traces. | |||
* Ensure that the .isr_vectors section is defined in the Cortex-M33 firmware. This section should be declared in the linker script and should contain the interrupt vector table. The Linux remoteproc driver will parse the ELF file to locate the .isr_vectors section and set the Cortex-M33 boot address to the corresponding base address. An example of a linker script can be find in {{CodeSource | STM32CubeMP2 | Projects/STM32MP257F-DK/Applications/USBPD/USBPD_DRP_UCSI/STM32CubeIDE/CM33/NonSecure/stm32mp2xx_DDR_m33_ns.ld}}. | |||
</onlyinclude> | </onlyinclude> | ||
|} | |} | ||
== Inter processor communication == | == Inter processor communication == | ||
{{ReviewsComments|-- [[User:Michel Jaouen|Michel Jaouen]] ([[User talk:Michel Jaouen|talk]]) 09:04, 14 June 2024 (CEST)<br />Add one error on table : when ipcc channel probing failed on linux, it can be a misalignment between channel number set in linux and protection on these channel set in optee rif dts (i.e dts RIF set protection on channel 1 , while linux dts set 0 to access channel 1 | |||
{{ReviewsComments|-- [[User:Arnaud Pouliquen|Arnaud Pouliquen]] ([[User talk:Arnaud Pouliquen|talk]]) 16:04, 4 November 2024 (CET)<br />Please provide the array input directly.}}}} | |||
{{:Troubleshooting grid table template}} | {{:Troubleshooting grid table template}} | ||
<onlyinclude> | <onlyinclude> | ||
Line 45: | Line 93: | ||
</includeonly> | </includeonly> | ||
| | | | ||
Frozen firmware as consequence of a deadlock in OpenAMP during IP communication | Frozen firmware as consequence of a deadlock in OpenAMP during IP communication between the both processors. | ||
|| | || | ||
Issue probably comes from rpmsg_virtio_rx_callback or rpmsg_virtio_send_offchannel_raw (rpmsg_virtio.c) functions | This Issue probably comes from rpmsg_virtio_rx_callback or rpmsg_virtio_send_offchannel_raw (rpmsg_virtio.c) functions that are called in interrupt context. These functions use a mutex lock in rpmsg_device struct when accessing the index of the virtio queue index. Rework your code so that these functions are not called in interrupt context. | ||
|- | |- | ||
| | | | ||
Line 53: | Line 101: | ||
stm32-ipcc 4c001000.mailbox: Try increasing MBOX_TX_QUEUE_LEN | stm32-ipcc 4c001000.mailbox: Try increasing MBOX_TX_QUEUE_LEN | ||
|| | || | ||
On each IPCC interrupt, the coprocessor treats all the | * On each IPCC interrupt, the Cortex-M coprocessor treats all the buffered RPMsgs (one IPCC event for several RPMsgs). On Linux side, one IPCC signal is programmed for each RPMsg sent. This can result is an overflow warning on Linux since too many IPCC events are queued. No RPMsgs are dropped but this message could be interpreted as the Cortex-M coprocessor reaches its capacity to treat the received messages in time. Consider reworking the code so that the Cortex-M coprocessor processes messages more efficiently or decreasing the rate of messages sent by Linux. | ||
Consider | * Another possible root cause could be that the IPCC was not properly deinitialized when the STM32Cube firmware was previously stopped, and the IPCC channels were not released. To prevent this issue, the STM32Cube firmware should implement the shutdown process as shown in the CoproSync_ShutDown example, and calls the HAL_IPCC_DeInit() API. | ||
|- | |- | ||
| | | | ||
Line 60: | Line 108: | ||
rpmsg_tty virtio0.rpmsg-tty-channel.-1.0: timeout waiting for a tx buffer | rpmsg_tty virtio0.rpmsg-tty-channel.-1.0: timeout waiting for a tx buffer | ||
|| | || | ||
This message means that there is no more TX buffer available to transmit | This message means that there is no more TX buffer available to transmit messages to the remote processor. | ||
This may happen for two reasons: | This may happen for two reasons: | ||
* The firmware implementation is incomplete and the coprocessor does not process any IPCC interrupt (interrupt disabled | * The firmware implementation is incomplete and the Cortex-M coprocessor does not process any IPCC interrupt (eg interrupt disabled or interrupt handler not defined). Fix the firmware code: refer to [[IPCC_internal_peripheral]] for details on the peripheral. | ||
* The coprocessor is busy, frozen or crashed. This can be confirmed by a debug tool analysis. | * The Cortex-M coprocessor is busy, frozen or crashed. This can be confirmed by performing a debug tool analysis. | ||
|- | |- | ||
| | | | ||
Line 69: | Line 117: | ||
rpmsg_tty virtio0.rpmsg-tty-channel.-1.0: No memory for tty_prepare_flip_string | rpmsg_tty virtio0.rpmsg-tty-channel.-1.0: No memory for tty_prepare_flip_string | ||
|| | || | ||
There is no more space in the TTY temporary buffer on reception. The root cause is probably that the Linux application | There is no more space in the TTY temporary buffer on reception. The root cause is probably that the Linux application did not read the tty device on time to treat the incoming TTY stream. | ||
Consider | Consider reworking the Linux application so that it takes less time to process messages or decreasing the message exchange rate. | ||
|- | |- | ||
| | | | ||
Line 76: | Line 124: | ||
remoteproc remoteproc0: stm32_rproc_kick: failed (<mbx>, <error value>) | remoteproc remoteproc0: stm32_rproc_kick: failed (<mbx>, <error value>) | ||
|| | || | ||
The Linux remoteproc driver | The Linux remoteproc driver cannot use the [[IPCC_internal_peripheral | IPCC]] mailbox. This may happen for two reasons: | ||
* The Linux kernel is built without the support of the stm32 IPCC mailbox: enable it, | * The Linux kernel is built without the support of the stm32 IPCC mailbox: to enable it, refer to [[Linux_Mailbox_framework_overview#Configuration|IPCC configuration]]. | ||
* The mailboxes are not | * The mailboxes are not or incorrectly defined in the Linux kernel DeviceTree: fix it as described in [[Linux_remoteproc_framework_overview#Device_tree_configuration|mailbox DeviceTree]]. | ||
</ | |- | ||
| | |||
stm32Cube error: | |||
VIRT_UART_Transmit() returns an error until a first message<br>is received from the Cortex-A. | |||
| style="width:500px;; text-align:left;" | Before the Cortex-M can send any message, the RPMsg protocol requires that the Linux application has sent a first message (to provide its address to the Cortex-M).<BR> | |||
The Linux and/or the Cortex-M applications shall be reworked to follow this constraint. | |||
|} | |} | ||
Line 86: | Line 139: | ||
[[Category:Coprocessor management STM32Cube]] | [[Category:Coprocessor management STM32Cube]] | ||
[[Category:Troubleshooting grids]] | [[Category:Troubleshooting grids]] | ||
{{PublicationRequestId | 14609 | 2020-01-15 |}} | |||
</noinclude> | </noinclude> |
Latest revision as of 16:02, 20 June 2025
Some typical issues related to the management of a Cortex-M coprocessor are listed below. Solutions or debugging methods are proposed for these issues. If your issue is not listed, try looking in the articles in the Coprocessor management Linux, Coprocessor management STM32Cube or troubleshooting grids categories.
1. Cortex-M coprocessor firmware loading and control[edit | edit source]
Symptom | Resolution |
---|---|
The coprocessor traces are not available on Linux® side
cat /sys/kernel/debug/remoteproc/remoteproc0/trace0
No such file or directory
|
This may happen for two reasons:
readelf -l <elf file>
...
02 .data .resource_table .bss ._user_heap_stack
....
|
When starting the Cortex-M coprocessor from the bootloader (u-boot):
"unsupported fw ver: 0
Remote Processor 0 resource table Not found : 0x00000000-0x0 "
|
The firmware does not include any resource table. This is only a warning that does not prevent the firmware from starting properly. "rproc load_rsc" step can be bypassed. |
When Loading a signed firmware from OP-TEE:
"remoteproc remoteproc0: bad phdr da 0x80123db8 mem 0x7f36a8"
|
There is probably a mismatch between the firmware memory mapping and the memory regions declared in the Linux remoteproc device tree. Use the following command to verify it in the generated elf file:
readelf -l <elf file>
and compare the elf program header with the OP-TEE device tree reserved-memory declaration. |
When Loading a signed firmware from OP-TEE: TA: remoteproc_load_segment:887 Fails to clear segment, res = 0xffff0001""E/ |
There is probably a mismatch between the firmware memory mapping and the memory regions declared in the OP-TEE remoteproc device tree. Use the following command to verify it in the generated elf file:
readelf -l <elf file>
and compare the elf program header with the OP-TEE device tree reserved-memory declaration. |
When Loading a signed firmware from OP-TEE: TA: remoteproc_load_fw:1014 Can't Authenticate the firmware <res = 0xFFFF0000>""E/ |
This means the OP-TEE remoteproc framework detect something not valid in the the firmware format. The root cause can be:
cat sys/class/remoteproc/remoteproc0/fw_format
See Firmware_signature for details |
When Loading a ELF firmware from Linux on STM32MP2 series, there is no error but the Cortex-M33 does not start correctly. |
The boot address of the Cortex-M33 may be invalid. The Cortex-M33 boot address must correspond to the address of the Cortex-M33 interrupt vector table. To ensure the boot address is valid, follow these steps:
|
2. Inter processor communication[edit | edit source]
Symptom | Resolution |
---|---|
Frozen firmware as consequence of a deadlock in OpenAMP during IP communication between the both processors. |
This Issue probably comes from rpmsg_virtio_rx_callback or rpmsg_virtio_send_offchannel_raw (rpmsg_virtio.c) functions that are called in interrupt context. These functions use a mutex lock in rpmsg_device struct when accessing the index of the virtio queue index. Rework your code so that these functions are not called in interrupt context. |
Linux kernel trace: TX_QUEUE_LENstm32-ipcc 4c001000.mailbox: Try increasing MBOX_ |
|
Linux kernel trace ( example with rpmsg_tty driver):
rpmsg_tty virtio0.rpmsg-tty-channel.-1.0: timeout waiting for a tx buffer
|
This message means that there is no more TX buffer available to transmit messages to the remote processor. This may happen for two reasons:
|
Linux kernel trace:
rpmsg_tty virtio0.rpmsg-tty-channel.-1.0: No memory for tty_prepare_flip_string
|
There is no more space in the TTY temporary buffer on reception. The root cause is probably that the Linux application did not read the tty device on time to treat the incoming TTY stream. Consider reworking the Linux application so that it takes less time to process messages or decreasing the message exchange rate. |
Linux kernel trace:
remoteproc remoteproc0: stm32_rproc_kick: failed (<mbx>, <error value>)
|
The Linux remoteproc driver cannot use the IPCC mailbox. This may happen for two reasons:
|
stm32Cube error:
VIRT_UART_Transmit() returns an error until a first message |
Before the Cortex-M can send any message, the RPMsg protocol requires that the Linux application has sent a first message (to provide its address to the Cortex-M). The Linux and/or the Cortex-M applications shall be reworked to follow this constraint. |