nxp-mcuxpresso / rpmsg-lite

RPMsg implementation for small MCUs
BSD 3-Clause "New" or "Revised" License
235 stars 74 forks source link

rpmsg_lite_remote_init function call fails for MIMX8MM6_m4 #51

Closed Johannes-Schuler closed 1 month ago

Johannes-Schuler commented 1 month ago

Hi,

I'm trying to port rpmsg-lite for a MIMX8MM6_m4 core using Zephyr. I've created a rpmsg_platform_zephyr_ipm.c (which I basically just copied from imxrt1170), I changed the CMakeLists.txt and I'm able to build my application. My main is the zephyr/samples/rpmsglite_pingpong/remote/src/main.c

My Overlay looks like this:

/ {
  chosen {
    zephyr,ipc_shm = &sramx;
    zephyr,ipc = &mailbox0;
  };

  sramx: memory@B8000000 {
    compatible = "mmio-sram";
    reg = <0xB8000000 DT_SIZE_K(16)>;
  };
};

and my prj.conf looks like this:

CONFIG_IPM=y
CONFIG_EVENTS=y
CONFIG_PRINTK=y
CONFIG_RPMSGLITE=y
CONFIG_STDOUT_CONSOLE=n
CONFIG_TIMESLICE_SIZE=1
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_PLATFORM_SPECIFIC_INIT=n
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096
CONFIG_SECOND_CORE_MCUX=y

# Uncomment for Debugging Support
CONFIG_INIT_STACKS=y
CONFIG_NO_OPTIMIZATIONS=y
CONFIG_DEBUG_THREAD_INFO=y
CONFIG_THREAD_STACK_INFO=y

When I start to debug, it will fail on gp_rpmsg_dev_inst = rpmsg_lite_remote_init(shared_memory, RPMSG_LITE_LINK_ID, RL_NO_FLAGS, &g_rpmsg_ctxt);. I can't do a "Step Into" and if I set a breakpoint at the beginning of this function, the debug process will never reach it. What is happening here? The init function should work without a working master on the A53 core, right?

I'm very grateful for a quick response!

MichalPrincNXP commented 1 month ago

Hello @Johannes-Schuler , I am sorry for late response. Unfortunately I am not able to address your question, @TomasGalbickaNXP could you please help with that? Note, Tomas is currently on vacation and his response could be delayed.

Johannes-Schuler commented 1 month ago

Hello @MichalPrincNXP , thanks for your response. I already fixed this issue. I needed to comment out the debug configuration parameters, except CONFIG_NO_OPTIMIZATIONS. After this, I was able to debug. I've still not finished the porting but this particular problem is not causing any issues anymore.

MichalPrincNXP commented 1 month ago

Thank you @Johannes-Schuler for confirming your issue have been solved. And, I am sorry for late response again. Have a nice day. Regards Michal