2020-05-09 03:16 AM
Hi, I use SPI1 and SPI4 in CM4 context on my custom board. Now, I use SPI_FullDuplex_ComIT_Master_CM4.elf binary to test those SPI controllers. The SPI4 is working, but the SPI1 doesn't working. Below is the log when SPI1 firmware started
root@stm32mp1:~# echo "start" > /sys/class/remoteproc/remoteproc0/state
[ 47.494072] remoteproc remoteproc0: powering up m4
[ 47.549448] remoteproc remoteproc0: Booting fw image SPI_FullDuplex_ComIT_Master_CM4.elf, size 2009036
[ 47.557833] remoteproc remoteproc0: header-less resource table
[ 47.564191] remoteproc remoteproc0: not resource table found for this firmware
[ 47.571421] remoteproc remoteproc0: header-less resource table
[ 47.637048] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:serial@4000e000 (ops 0xc0a935f8)
[ 47.646744] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:serial@40011000 (ops 0xc0a935f8)
[ 47.672140] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:dac@40017000 (ops 0xc0a935f8)
[ 47.683090] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:timer@44000000 (ops 0xc0a935f8)
[ 47.692995] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:spi@44004000 (ops 0xc0a935f8)
[ 47.703386] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:spi@44005000 (ops 0xc0a935f8)
[ 47.714816] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:can@4400e000 (ops 0xc0a935f8)
[ 47.726435] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:adc@48003000 (ops 0xc0a935f8)
[ 47.737277] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:m4_led (ops 0xc0a935f8)
[ 47.746739] remoteproc remoteproc0: remote processor m4 is now up
I just change the macro from SPI4 to SPI1 for test SPI1.
static void MX_SPI4_Init(void)
{
/* SPI4 parameter configuration*/
hspi4.Instance = SPI1;
Did I missing something?
2020-05-10 11:44 PM
Hello,
all peripheral clock sources are handled by Linux side, so you need to correctly set SPI1 in device tree. You could use CubeMx to assign SPI1 to M4 and look at the impact in DT.
Regards,
Patrick
2020-05-11 03:50 AM
Hi Patrick, I had already configure the sp1 for CM4 in kernel dts.
109 &spi1 {
110 status = "disabled";
111 };
112
113 &m4_spi1 {
114 pinctrl-names = "rproc_default";
115 pinctrl-0 = <&spi1_pins_a>;
116 status = "okay";
117 };
And I also configure spi1 and spi5 on DK2 board. It's not working too.
2020-05-11 05:37 AM
On Linux side, could you please check RCC config in Device tree (especially if correct SPI kernel clock is enabled)
On M4 side, could you check if stm32mp1xx_hal_msp.c is updated for SPI1