Bug: Servo [Resolved]

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

Post Reply
medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Bug: Servo [Resolved]

Post by medelec35 »

If target device does not have port B then flowchart containing servo will fail to compile:

Code: Select all

Servo controller.c: myisr()
  1237:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x2; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x2) : (FCP_PORT_B = FCP_PORT_B & ~0x2);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	            (192) undefined identifier "FCP_PORT_B" ^
  1253:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x4; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x4) : (FCP_PORT_B = FCP_PORT_B & ~0x4);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	            (192) undefined identifier "FCP_PORT_B" ^
  1269:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x8; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x8) : (FCP_PORT_B = FCP_PORT_B & ~0x8);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	            (192) undefined identifier "FCP_PORT_B" ^
  1285:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x10; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x10) : (FCP_PORT_B = FCP_PORT_B & ~0x10);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	             (192) undefined identifier "FCP_PORT_B" ^
  1301:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x20; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x20) : (FCP_PORT_B = FCP_PORT_B & ~0x20);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	             (192) undefined identifier "FCP_PORT_B" ^
  1317:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x40; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x40) : (FCP_PORT_B = FCP_PORT_B & ~0x40);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	             (192) undefined identifier "FCP_PORT_B" ^
  1333:	{MX_UINT8 ptmp = (1); FCP_TRIS_B &= ~0x80; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x80) : (FCP_PORT_B = FCP_PORT_B & ~0x80);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	             (192) undefined identifier "FCP_PORT_B" ^
  1454:	{MX_UINT8 ptmp = (0); FCP_TRIS_B &= ~0x2; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x2) : (FCP_PORT_B = FCP_PORT_B & ~0x2);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	            (192) undefined identifier "FCP_PORT_B" ^
  1470:	{MX_UINT8 ptmp = (0); FCP_TRIS_B &= ~0x4; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x4) : (FCP_PORT_B = FCP_PORT_B & ~0x4);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	            (192) undefined identifier "FCP_PORT_B" ^
  1486:	{MX_UINT8 ptmp = (0); FCP_TRIS_B &= ~0x8; (ptmp) ? (FCP_PORT_B = FCP_PORT_B | 0x8) : (FCP_PORT_B = FCP_PORT_B & ~0x8);};
	                      ^ (192) undefined identifier "FCP_TRIS_B"
	            (192) undefined identifier "FCP_PORT_B" ^
Servo controller.c: 1502: too many errors (21)
(908) exit status = 1
(908) exit status = 1

C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe reported error code 1

Servo connected to port C2
Attachments
Servo controller.fcfx
(9.03 KiB) Downloaded 185 times
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Bug: Servo

Post by Benj »

Hi Martin,

Thanks for letting us know.

It seems the code is still correct in that the unused channels are being placed behind unreachable code. Ideally this would be optimised out but maybe it's not doing so? I need to investigate as this used to be ok, though maybe that was under BoostC?

Code: Select all

            if (1 > 1)
            {
                if (FCV_0dd21_Servo_Controller1__SERVO_IDX == 1)
                {
                    FCP_SET(B, B, 0x2, 0x1, 1);
                }
            } 
Current workaround is set the servo channels to 8 and assign all the pins to viable pins on your microcontroller. Then change the channel back to the actual number of channels you need.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Bug: Servo

Post by medelec35 »

Thanks Ben.
UAURT component is the same.
Will not compile unless select Flow control to ON, change port from port B then select Flow Control OFF.

Martin
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Bug: Servo

Post by Benj »

I need to investigate as this used to be ok, though maybe that was under BoostC?
Nope I'm wrong, v6 is doing the exact same thing. Hmm. I'll keep looking.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Bug: Servo

Post by Benj »

Right here is the fixed servo component for Flowcode 7.
Servo_Controller.fcpx
(19.02 KiB) Downloaded 188 times
Just looking into the UART problem now.

If you spot any others then please shout.


Edit. I can't seem to replicate the UART issue. Is it with the CAL UART or the UART (RS232) component?

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Bug: Servo [Resolved]

Post by medelec35 »

Hi Ben,
Fix works a treat....Thanks.
Benj wrote:Edit. I can't seem to replicate the UART issue. Is it with the CAL UART or the UART (RS232) component?
Sorry,
When the comping failed with both UART & Servo, I checked the hidden connections and both of them was showing port B
I just assumed that would cause a compile failure with both components,
So you are correct there is no issue with UART


Martin
Martin

Post Reply