UART Macro wont compile after update.

Any bugs you encounter with Flowcode should be discussed here.
Sasi
Posts: 105
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 37 times
Been thanked: 13 times

Re: UART Macro wont compile after update.

Post by Sasi »

Hi Martin,

Thank you for addressing the issue.
I tried what you suggested, but it did not solve the problem.
The situation remains the same: it does not work with XC8 v2.45 and v2.46, but it does with v2.50.
Regards,
Sasi

medelec35
Matrix Staff
Posts: 1950
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 624 times
Been thanked: 656 times

Re: UART Macro wont compile after update.

Post by medelec35 »

Hi Sasi.
I was able to compile, and send a string with v2.45, with the PIC String CAL.
What issues have you still got with v2.45 and 18F46K80?
Martin

Sasi
Posts: 105
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 37 times
Been thanked: 13 times

Re: UART Macro wont compile after update.

Post by Sasi »

Hi Martin,

This is interesting.
For me, the SendString command only works with the v2.50 compiler.
I did everything as you described. I updated the libraries used, then overwrote the PIC_CAL_String.c file with the one you sent.
I attached the Flowcode10 project file used for testing.
Sending_a_String_via_UART_in_3_different_ways..fcfx
(19.45 KiB) Downloaded 22 times
In principle, there are three different ways to send a String via UART in this project, but for me they only work with v2.50.
You can find my experiences in the comments to the program.
I would be very happy if you could find a solution for it.

Regards,
Sasi

Steve-Matrix
Matrix Staff
Posts: 1475
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 205 times
Been thanked: 349 times

Re: UART Macro wont compile after update.

Post by Steve-Matrix »

The new PIC_CAL_String.c file fixes the compilation error we saw when trying to compile a project on the 16F46K80 device using the v2.45 compiler.

Without the new file, the following message was produced:

Code: Select all

"C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\PIC\PIC_CAL_String.c:871:: error: (712) can't generate code for this expression"
This was caused by an odd issue with the optimisations used to compile string concatenation code for that device on certain versions of the compiler.

The issue you are having now seems to be a different one as I can successfully compile your project with or without the new CAL file.

Sasi
Posts: 105
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 37 times
Been thanked: 13 times

Re: UART Macro wont compile after update.

Post by Sasi »

Hi Steve,

Thank you for your answer.
In my case, any version of the compiler always compiles the projects without errors, regardless of the version of the PIC_CAL_String.c file I use.
However, the functionality of the .hex file generated during the compilation depends on the compiler version.
Only using the XC8 v2.50 compiler can I generate a working hex file from the test project, as far as String operations are concerned. However, in this case, the digital port bit inputs become inoperable.

So, when using XC8 v2.45, the program compiles fine, but the generated .hex file does not work properly, the results of String operations seem to be incorrect. Based on the result of the program run, it seems that Length$("FLOWCODE")=0 and Char$("FLOWCODE",0)=0.

Is there a way for you to check the functionality of the compiled .hex file?
Sasi

Postscript:
The solution was to set the "Table Read Protect Boot" bit to "Disabled" in the configuration settings.
More information can be found here:
https://developerhelp.microchip.com/xwi ... tion-bits/

jay_dee
Posts: 207
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 78 times
Been thanked: 55 times

Re: UART Macro wont compile after update.

Post by jay_dee »

Hi,
I rather stupidly clicked the FC10 updates, what was compiling yesterday, will no longer compile today.
I had previously tried Martins work around and was unable to get it to work.
Sasi, workaround. Maybe I'm not doing it correctly this time...but this does not seem to work.

I can report the error codes I get but frankly I think I'm just screwing the installation up with each change.

I'm getting a bit lost.
I generally only use PIC16, PIC18 and Pi PICO, it seems odd that a simple update keeps breaking support for these common parts.
J.
P.S. I've started a new 18F2585 FC program, this compiles and I'm drawing parts across from the non-compiling version untill I find what stops it.
hey ho see how we go. :)

Steve-Matrix
Matrix Staff
Posts: 1475
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 205 times
Been thanked: 349 times

Re: UART Macro wont compile after update.

Post by Steve-Matrix »

Do you have any earlier working versions of your project that was compiled into C code?

The old C code for these will include the component versions and timestamps and that might help work out which components have changed version and might need to be reverted.

jay_dee
Posts: 207
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 78 times
Been thanked: 55 times

Re: UART Macro wont compile after update.

Post by jay_dee »

Hi,
This is a hack bit of FC which is just to test a GLCD over i2C.
What is odd, is this compiled fine a few minutes ago.
Added a "PrintNumber" and it failed to compile.
But even if I remove that function, it wont re-compile.
TECI_Mini_PIC18F2585_MPH_V1-0_NoUART.fcfx
(37.94 KiB) Downloaded 11 times
I get the following error;
I:\01\MPH_Display\FlowCode>"C:\Program Files (x86)\Flowcode\Common\Compilers\picv2\bin\xc8-cc.exe" -mcpu=18F2585 "TECI_Mini_PIC18F2585_MPH_V1-0_NoUART.c" -w=359,1273,1388 -fno-short-float -fno-short-double -std=c90 -O1
TECI_Mini_PIC18F2585_MPH_V1-0_NoUART.c:1472:2: error: (192) undefined identifier "S"
TECI_Mini_PIC18F2585_MPH_V1-0_NoUART.c:1472:4: error: (195) expression syntax
TECI_Mini_PIC18F2585_MPH_V1-0_NoUART.c:2207:171: error: (296) out of memory
(908) exit status = 1

Error returned from [xc8.exe]

C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\PIC\batch\pic_xc8_comp.bat reported error code 0x1
I've attached the 'C' but is shows the same time stamp as the failed compile.
Attachments
TECI_Mini_PIC18F2585_MPH_V1-0_NoUART.c
(183.64 KiB) Downloaded 10 times

jay_dee
Posts: 207
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 78 times
Been thanked: 55 times

Re: UART Macro wont compile after update.

Post by jay_dee »

Ah...dropped the font size and it seems to compile.
I think I'm struggling with various issues... I'll try again with a fresh head tomorrow. This i2C GLCD wont play ball either.

Post Reply