Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 6 Forum Discussions

VarunK_66
Employee
Employee
First reply posted First question asked Welcome!

Hi Team, 

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.

 

Regards,

Varun Kaushik

0 Likes
5 Replies
PRI
Moderator
Moderator
Moderator
5 likes given 10 likes received 100 sign-ins

Hi Varun,

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.

Thanks 

0 Likes
VarunK_66
Employee
Employee
First reply posted First question asked Welcome!

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. 

0 Likes
VarunK_66
Employee
Employee
First reply posted First question asked Welcome!

I created two independent projects 

  1. https://github.com/Infineon/mtb-example-wifi-mqtt-client for CM0p.
  2.  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. 

VarunK_66_1-1674200863698.png

 

This is my CM4 code:

VarunK_66_0-1674200791053.png

 

When I got both applications to run (it doesn't seem to reliably run both cores), this is my observation:

VarunK_66_2-1674201003857.png

 

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): 

CM0p:

VarunK_66_3-1674201051209.png

CM4:

VarunK_66_6-1674201130086.png


VarunK_66_4-1674201089654.png

 

 

0 Likes
VarunK_66
Employee
Employee
First reply posted First question asked Welcome!

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. 

VarunK_66_7-1674201268271.png

 

My questions: 

  • 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?

 

0 Likes
VarunK_66
Employee
Employee
First reply posted First question asked Welcome!

Posting the log of fully functional MQTT Client on CM0p. There are missing prints from the CM4 application. 

VarunK_66_0-1674467046135.png

 

0 Likes