I'm working on a use case where I have to run MQTT, HTTPs applications on the CM0p core of my PSoC 6 (2M part). I see that the code examples on github.com/Infineon by default run on the CM4 core after the CM0p goes to sleep. I am aware of a Makefile variable called CORE=CM0p but is that enough to successfully build and run a code example (obviously, after the linker script updates to provide sufficient memory for the code coming on the CM0p)? Further, I am also concerned about the code space - if it is possible to fit this into <1M flash (or <512K of flash excluding the 43xxx firmware). like https://github.com/Infineon/mtb-example-wifi-https-server or https://github.com/Infineon/mtb-example-wifi-mqtt-client?
Request you to link me to the sufficient resources to help my use case.
Can you let me know which exact PSoC 6 part or eval board you're using for your use case? Meanwhile, i will check the dependencies for your use case and try to implement it on my side.
I am using the RP01 feather kit - CYSBSYSKIT-DEV-01 which contains PSoC 6 + 43012.
My endgame is to implement another custom BSP such that the CM0p sleep code is replaced with this custom firmware on the CM0p while CM4 is up for me to run some other code which might be totally unrelated.
But I first want to try an existing code example (mentioned above) to run in CM0p core even if CM4 remains dead.
I created two independent projects
- https://github.com/Infineon/mtb-example-wifi-mqtt-client for CM0p.
- A modified https://github.com/Infineon/mtb-example-hal-hello-world for CM4. The modification is described below.
I made the edits to my respective linker scripts such that 1M of flash and approximately 512K of RAM for each core. I observe a strange behavior - when the CM4 app is running the CM0p doesn't run and vice versa. I tried to use debugger for one core while the other is running but that did not help as by debug session itself did not start.
This is the one line I added in the MQTT_Client CE code to start CM4.
This is my CM4 code:
When I got both applications to run (it doesn't seem to reliably run both cores), this is my observation:
While I expect the user LED to toggle and the UART print to appear every 1 sec, it seems to be appearing after 5-6 seconds and showing unpredictable behavior.
GCC_ARM Linker script modifications (rest of the *.ld file remains intact):
With the said above behavior, if my CM0p code changes to a periodic print statement (like the one I had for CM4 in the above post), I am getting a proper working predictable behavior.
- Is there any asset in FreeRTOS, WHD, WCM, etc. that is making my system behavior like this?
- Is this a problem with retarget-io as I do not see its usage in dual core code examples like https://github.com/Infineon/mtb-example-psoc6-dual-cpu-ipc-sema.
- Why did a debug session from Eclipse IDE for MTB did not start for me? Is debugging supported on one core while the other is running some application?
Posting the log of fully functional MQTT Client on CM0p. There are missing prints from the CM4 application.