my dts configure is:
rpmsg_gpioa: gpio@0 {
compatible = "fsl,imx-rpmsg-gpio";
port_idx = <0>;
gpio-controller;
#gpio-cells = <2>;
#interrupt-cells = <2>;
interrupt-controller;
interrupt-parent = <&rpmsg_gpioa>;
status = "okay";
};
and when the system start , i do the command below
gpioget -c gpiochip0 0
[ 1387.700991] gpio_rpmsg virtio0.rpmsg-io-channel.-1.4: rpmsg not ack 1!
gpioget: unable to request lines: Invalid argument
I sure the gpiochip0 is the gpioa,
how can I control the m33 gpio?
Hello!我有了一些新的进展,我调用CLOCK_SetIpSrc成功设置了时钟,也读到了kCLOCK_Lpuart2,为0x80000000。但是我在while循环调用LPUART_WriteByte(DEMO_LPUART, 0xaa)接口往串口写数据,调用LPUART_ReadByte(DEMO_LPUART)读数据。却没有读到数据,波形也没测量到。用串口调试助手发数据能接收到,说明硬件是没问题的。我下一步应该往什么方向排查呢?谢谢!附件为我的patch。
Hello @wendy-liu
你现在能在串口看到打印信息对吧?原来main函数的收发逻辑无法正常使用吗?demo说明有下注意事项。
The lpuart_polling Example project is to demonstrate usage of the KSDK lpuart driver.
In the example, you can send characters to the console back and they will be printed out onto console
instantly.
Note: Please input one character at a time. If you input too many characters each time, the receiver may overflow
because the LPUART uses simple polling way for receiving.
不行你就把LPUART2的寄存器 dump出来,然后和LPUART1的比较一下差异吧。
Best Regards,
Zhiming
Hello,
LPUART1的PCC REG是
你读出来的LPUART2的REG只有第31是1,你把这个寄存器读取放到RESET_PeripheralReset之后再读一次看看?
还有:BOARD_InitDebugConsole中会用到LPUART1的这些宏,你都改成2了吗?
Best Regards,
Zhiming
Hello,
我现在和你同步了一下进度,可以接收数据。设置参考的你的补丁。
reg = d2000000, 94000000
LPUART_WriteBlocking
get readbuf = 33
get readbuf = 33
get readbuf = 33
get readbuf = 34
get readbuf = 34
get readbuf = 34
get readbuf = 35
get readbuf = 35
get readbuf = 35
get readbuf = 36
get readbuf = 36
get readbuf = 36
get readbuf = 37
get readbuf = 37
get readbuf = 37
get readbuf = 37
get readbuf = 38
get readbuf = 38
get readbuf = 38
get readbuf = 39
get readbuf = 39
get readbuf = 39
Best Regards,
Zhiming
你的板子是不是哪里有问题?我这里是用的USB转TTY测试的,另外我还测试了eDMA的移植过程,也可以正常用。
Hello,
理论上是可以开放Pbridge2的特定内存区域给指定domain的,控制MBC3即可,开放PCC2和LPUART2的控制权给M33。对应的LPUART2中断号也在M33中定义了。
核心问题是时钟,由于这个LPUART2做在了DSP里,必须使能dsp_busclk,至少得加载dsp固件。具体的过程我还没试过。
Best Regards,
Zhiming
PCC2和LPUART2的MBC权限我也配置了,
/* non secure state can access lpuart2(PBridge2 slot 11, T-MBC3) for eDMA0 */
mbcBlockConfig.memoryAccessControlSelect = TRDC_MBC_ACCESS_CONTROL_POLICY_ALL_INDEX;
mbcBlockConfig.nseEnable = true; /* non secure state can access the block for eDMA0 */
mbcBlockConfig.mbcIdx = 3U; /* MBC3 */
mbcBlockConfig.domainIdx = TRDC_DMA0_DOMAIN_ID; /* MBC3_DOM0 */
mbcBlockConfig.slaveMemoryIdx = 0U; /* MBC3_DOM0_MEM0 */
mbcBlockConfig.memoryBlockIdx = 11U; /* MBC3_DOM0_MEM0_BLK_CFG_W11 */
TRDC_MbcSetMemoryBlockConfig(TRDC, &mbcBlockConfig);
/* non secure state can access PCC2(PBridge2 slot 2, T-MBC3) for eDMA0 */
mbcBlockConfig.memoryAccessControlSelect = TRDC_MBC_ACCESS_CONTROL_POLICY_ALL_INDEX;
mbcBlockConfig.nseEnable = true; /* non secure state can access the block for eDMA0 */
mbcBlockConfig.mbcIdx = 3U; /* MBC3 */
mbcBlockConfig.domainIdx = TRDC_DMA0_DOMAIN_ID; /* MBC3_DOM0 */
mbcBlockConfig.slaveMemoryIdx = 0U; /* MBC3_DOM0_MEM0 */
mbcBlockConfig.memoryBlockIdx = 2U; /* MBC3_DOM0_MEM0_BLK_CFG_W2 */
TRDC_MbcSetMemoryBlockConfig(TRDC, &mbcBlockConfig);
你这个用的不对TRDC_DMA0_DOMAIN_ID,这两个外设应该给M33 domain:TRDC_M33_DOMAIN_ID
#if 0
/* 5. Assign domain ID for m33 */
trdc_processor_domain_assignment_t domainAssignment;
TRDC_GetDefaultProcessorDomainAssignment(&domainAssignment);
domainAssignment.domainId = TRDC_M33_DOMAIN_ID;
TRDC_SetProcessorDomainAssignment(TRDC, &domainAssignment);
#endif
Hello @Zhiming_Liu
I want to use lpuart polling example on SDK, the demo_example is LPUART1, but I want to use LPUART2.
How to config PCC_REG(kCLOCK_Lpuart2)?I read reg of LPUART1 and LPUART2 CLOCK, result is 0xd2000000 and 0.I guess the system has configured the LPUART clock with default settings.
Hello,
Please use other clock as source, then continue debug, you may need to configure trdc for edma access like LPUART1 in BOARD_SetTrdcGlobalConfig
Best Regards,
Zhiming