hi @Zhiming_Liu ;
Thank you for the reply and sorry for the slow response.
I am not sure we agree on what I am trying to do here.
The dsp_pdm_sai example (examples/evkmimx8ulp/dsp_examples/pdm_sai) certainly controls the PDM, but it does so from dsp/main_dsp.c which runs on the DSP core, and the M33 core does not do anything after starting the DSP core.
I am trying to access DSP peripherals directly from the M33 core without starting the DSP core (I do not have a license to use XCC to modify or build DSP images, so using the mailbox to control the DSP core from the M33 is not a solution either).
The dsp pdm_sai example also does not modify the TRDC (MRC/MBC) at all from the common board configuration.
I've tried adding more blocks to the TRDC Mbc without much success. I tried looking at the trdc example (examples/evkmimx8ulp/driver_examples/trdc) and it does not look like I get a fault when accessing PCC2->PCC_LPSPI2 (0x2810_2034) but LPSPI2 cannot work if that register is 0.
I have attached the patch I tried with the trdc example, here is the output I get printing PCC2->PCC_LPSPI2 (and LPSPI1 for sanity checking), after having set the MDC as you suggested (for the PCC2 block)
TRDC example start
other init
XXXXXXX LPSPI1 80000000 @ 280300fc ; LPSPI2 0 @ 28102034
Set the MRC selected memory region not accessiable
Violent MRC access at address: 0x40000000
The MRC selected region is accessiable now
Set the MBC selected memory block not accessiable
Violent MBC access at address: 0x28800000
The MBC selected block is accessiable now
TRDC example Success
It would be greatly appreciated if you could point me in the right direction.
Thank you,
Dominique