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

PSoC™ 5, 3 & 1 Forum Discussions

Level 3
Level 3
10 replies posted 10 sign-ins 5 replies posted


I'm trying to have software that work on different board according to a version numbre that I have in the flash.

On my 2 boards the CAN pins are not the same. SO I want to be able to select the CAN pin at runtime with a if (version > 2) in my software.

I've tried to put a MUX and DEMUX between the CAN and the IO, but I get this error :

"Error: mpr.M0074: The RX port on CAN block "\CAN_1:CanIP\" must be directly connected to an IO pin. (App=cydsfit)
Error: mpr.M0074: The TX port on CAN block "\CAN_1:CanIP\" must be directly connected to an IO pin. (App=cydsfit)"


Any idea on how I could do that ?

I want the selection do be done at the runtime, because the version of the board is written in the bootloader, and I want to use the same boot loadable for both board.


Thanks in advance for any help



4 Replies
Level 9
Level 9
500 solutions authored 1000 replies posted 750 replies posted


I've reproduced the same errors.

When the CAN component was created, there are some designer available compile options.  One of them is to throw an error if the pin is not directly connected to an IO pin.  This appears to be the case.

Sometimes, you can modify the component design files to ignore this condition.  I've looked at the CAN component files and could not find a way to do this.  The only design file I could not parse is the .dll file of the component.  This might be where the test is being performed.

I realize you want to switch the CAN input and output at runtime.  The Mux/Demux would have been the way to do this.

An alternate way is significantly more complicated.

The CAN block is a fixed resource.  At design time in the TopDesign and DWR/Pins definitions, the IO pins are assigned.  During the Application Build phase, the digital routing between the CAN block and IO pins are established.  The routing information is just register writes.

After the PSoC gets programmed shortly before running main(), the register writes to configure the IO to internal resources (digital and analog) are completed.

Since all the digital routing is done with register writes, you could find out how to modify the registers at runtime to perform the equivalent of the Control Reg muxing.

Easier said than done.   Maybe someone from Infineon can aid you in this effort.

"Engineering is an Art. The Art of Compromise."

That would be nice, to find some documentation about the register doing the IO mapping.

Thanks for your help.

For this board, I'll cut my track and connect them to the old CAN pin.



If the use of the Mux/Demux is rare, you might consider a board with resistors to place 0 ohm to make the connections.

I thought about a two 3-pin headers with jumpers to connect which CAN bus sets to use.  This issue with the method is the potential signal reflections at high-speed that could cause the signal eye-pattern to close up.

"Engineering is an Art. The Art of Compromise."

no, no my question was about the issue of using the mux/ demux with the CAN module.
I've got plenty of ressource still available on the PSOC.

On the hardware side, I'll manage. Hopefully I don't have to many board with the new layout, and the old pins are still available.

It's just that I didn't see it coming that the CAN module could only be routed directly to an IO pin and not to the MUX/DEMUX.

And I was hoping that someone could have a software solution to propose.