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
UART Macro wont compile after update.
-
- Posts: 117
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 12:11 pm
- Has thanked: 39 times
- Been thanked: 14 times
-
- Matrix Staff
- Posts: 2074
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 638 times
- Been thanked: 695 times
Re: UART Macro wont compile after update.
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?
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
Re: UART Macro wont compile after update.
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. 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
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. 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
-
- Matrix Staff
- Posts: 1545
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 214 times
- Been thanked: 360 times
Re: UART Macro wont compile after update.
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:
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.
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"
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.
Re: UART Macro wont compile after update.
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/
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/
Re: UART Macro wont compile after update.
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.
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.

-
- Matrix Staff
- Posts: 1545
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 214 times
- Been thanked: 360 times
Re: UART Macro wont compile after update.
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.
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.
Re: UART Macro wont compile after update.
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.
I get the following error;
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.
I get the following error;
I've attached the 'C' but is shows the same time stamp as the failed compile.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.c2: error: (192) undefined identifier "S"
TECI_Mini_PIC18F2585_MPH_V1-0_NoUART.c4: error: (195) expression syntax
TECI_Mini_PIC18F2585_MPH_V1-0_NoUART.c171: 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
- Attachments
-
- TECI_Mini_PIC18F2585_MPH_V1-0_NoUART.c
- (183.64 KiB) Downloaded 108 times
Re: UART Macro wont compile after update.
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.
I think I'm struggling with various issues... I'll try again with a fresh head tomorrow. This i2C GLCD wont play ball either.
Re: UART Macro wont compile after update.
I'ts been a while since I"ve used an Arduino Nano 328, but I'm sure that changing the UART settings from channel 1 to software did work in the past.
Today I wanted to get a UART working on other pins then Channel 1, but I get these error codes.
Maybe something to do with this topic?
Today I wanted to get a UART working on other pins then Channel 1, but I get these error codes.
Maybe something to do with this topic?
Code: Select all
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\AVR\batchfiles\avra.bat "C:\Program Files (x86)\Flowcode\Common\Compilers\avrv5\" atmega328p "D:\ArduinoProjects\BluetoothHC05\HC05-1.elf" "D:\ArduinoProjects\BluetoothHC05\HC05-1.c" "D:\ArduinoProjects\BluetoothHC05\HC05-1.lst"
D:\ArduinoProjects\BluetoothHC05>REM CRC: EA277D0C7EF9B4E537B79187D0BE7A25FA6080B4B01BE48BAF713429E4B690411241251B4A05C2B5828F4452C9F7348705C640EF477B79E0C7881D2E5EEC9BD69A0D46BD3B6AACB92DE4D84759EBB5079CA9DA2D2BBCDAE2A4D1C56CD1580BF5A24465F11D9C3B2DBA3F4E37F13004EE3637760F1F0B7DA0CC623CD30E3C7D6BAB4C3FE6151D92B8EC0ADD55E96639DAC02472BDE3806EF43AE3A028BD32A5DAE68BB191DA97CB6883A66D3C41849952BB2DD264AF32733E2C3050DA273BE4EE1FA30153290F2FAFBD2259D77AD477809E9C4D76400384BA5D2E1919BC6D834D57C406BC4A49D3F1
D:\ArduinoProjects\BluetoothHC05>REM REVISION: 1.0
D:\ArduinoProjects\BluetoothHC05>REM GUID: EA0828B2-5C70-41A5-8C54-F359DD5CC88B
D:\ArduinoProjects\BluetoothHC05>REM DATE: 08\08\2022
D:\ArduinoProjects\BluetoothHC05>REM DIR: FCD\AVR\batchfiles\avra.bat
D:\ArduinoProjects\BluetoothHC05>"C:\Program Files (x86)\Flowcode\Common\Compilers\avrv5\bin\avr-gcc.exe" -mmcu=atmega328p -Os -ffunction-sections -fdata-sections -funsigned-char -o "D:\ArduinoProjects\BluetoothHC05\HC05-1.elf" "D:\ArduinoProjects\BluetoothHC05\HC05-1.c" -lm -Wl,-gc-sections
In file included from D:\ArduinoProjects\BluetoothHC05\HC05-1.c:45:0:
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c: In function 'FC_CAL_UART_Init_1':
D:\ArduinoProjects\BluetoothHC05\HC05-1.c:154:27: error: 'tris' undeclared (first use in this function)
#define MX_UART_TX_TRIS_1 tris
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:445:38: note: in definition of macro 'set_bit'
#define set_bit( reg, bitNumb ) ((reg) |= (1 << (bitNumb)))
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:631:4: note: in expansion of macro 'FC_CAL_Bit_High_DDR'
FC_CAL_Bit_High_DDR (MX_UART_TX_PORT_X, MX_UART_TX_TRIS_X, MX_UART_TX_PIN_X); // Transmit pin is default high
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:75:26: note: in expansion of macro 'MX_UART_TX_TRIS_1'
#define CAL_APD(a, b) a##b
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:76:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:157:27: note: in expansion of macro 'CAL_APPEND'
#define MX_UART_TX_TRIS_X CAL_APPEND(MX_UART_TX_TRIS_, MX_UART_NUM)
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:631:44: note: in expansion of macro 'MX_UART_TX_TRIS_X'
FC_CAL_Bit_High_DDR (MX_UART_TX_PORT_X, MX_UART_TX_TRIS_X, MX_UART_TX_PIN_X); // Transmit pin is default high
^
D:\ArduinoProjects\BluetoothHC05\HC05-1.c:154:27: note: each undeclared identifier is reported only once for each function it appears in
#define MX_UART_TX_TRIS_1 tris
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:445:38: note: in definition of macro 'set_bit'
#define set_bit( reg, bitNumb ) ((reg) |= (1 << (bitNumb)))
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:631:4: note: in expansion of macro 'FC_CAL_Bit_High_DDR'
FC_CAL_Bit_High_DDR (MX_UART_TX_PORT_X, MX_UART_TX_TRIS_X, MX_UART_TX_PIN_X); // Transmit pin is default high
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:75:26: note: in expansion of macro 'MX_UART_TX_TRIS_1'
#define CAL_APD(a, b) a##b
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:76:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:157:27: note: in expansion of macro 'CAL_APPEND'
#define MX_UART_TX_TRIS_X CAL_APPEND(MX_UART_TX_TRIS_, MX_UART_NUM)
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:631:44: note: in expansion of macro 'MX_UART_TX_TRIS_X'
FC_CAL_Bit_High_DDR (MX_UART_TX_PORT_X, MX_UART_TX_TRIS_X, MX_UART_TX_PIN_X); // Transmit pin is default high
^
D:\ArduinoProjects\BluetoothHC05\HC05-1.c:168:27: error: 'port' undeclared (first use in this function)
#define MX_UART_TX_PORT_1 port
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:445:38: note: in definition of macro 'set_bit'
#define set_bit( reg, bitNumb ) ((reg) |= (1 << (bitNumb)))
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:631:4: note: in expansion of macro 'FC_CAL_Bit_High_DDR'
FC_CAL_Bit_High_DDR (MX_UART_TX_PORT_X, MX_UART_TX_TRIS_X, MX_UART_TX_PIN_X); // Transmit pin is default high
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:75:26: note: in expansion of macro 'MX_UART_TX_PORT_1'
#define CAL_APD(a, b) a##b
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:76:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:156:27: note: in expansion of macro 'CAL_APPEND'
#define MX_UART_TX_PORT_X CAL_APPEND(MX_UART_TX_PORT_, MX_UART_NUM)
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:631:25: note: in expansion of macro 'MX_UART_TX_PORT_X'
FC_CAL_Bit_High_DDR (MX_UART_TX_PORT_X, MX_UART_TX_TRIS_X, MX_UART_TX_PIN_X); // Transmit pin is default high
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c: In function 'FC_CAL_UART_Uninit_1':
D:\ArduinoProjects\BluetoothHC05\HC05-1.c:154:27: error: 'tris' undeclared (first use in this function)
#define MX_UART_TX_TRIS_1 tris
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:444:39: note: in definition of macro 'clear_bit'
#define clear_bit( reg, bitNumb ) ((reg) &= ~(1 << (bitNumb)))
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:1106:4: note: in expansion of macro 'FC_CAL_Bit_In_DDR'
FC_CAL_Bit_In_DDR (MX_UART_TX_PORT_X, MX_UART_TX_TRIS_X, MX_UART_TX_PIN_X); // Transmit pin is default high
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:75:26: note: in expansion of macro 'MX_UART_TX_TRIS_1'
#define CAL_APD(a, b) a##b
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:76:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:157:27: note: in expansion of macro 'CAL_APPEND'
#define MX_UART_TX_TRIS_X CAL_APPEND(MX_UART_TX_TRIS_, MX_UART_NUM)
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:1106:42: note: in expansion of macro 'MX_UART_TX_TRIS_X'
FC_CAL_Bit_In_DDR (MX_UART_TX_PORT_X, MX_UART_TX_TRIS_X, MX_UART_TX_PIN_X); // Transmit pin is default high
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c: In function 'FC_CAL_UART_Send_1':
D:\ArduinoProjects\BluetoothHC05\HC05-1.c:168:27: error: 'port' undeclared (first use in this function)
#define MX_UART_TX_PORT_1 port
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:444:39: note: in definition of macro 'clear_bit'
#define clear_bit( reg, bitNumb ) ((reg) &= ~(1 << (bitNumb)))
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:1207:4: note: in expansion of macro 'FC_CAL_Bit_Low'
FC_CAL_Bit_Low(MX_UART_TX_PORT_X, MX_UART_TX_PIN_X); // Send Start bit
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:75:26: note: in expansion of macro 'MX_UART_TX_PORT_1'
#define CAL_APD(a, b) a##b
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\internals.c:76:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:156:27: note: in expansion of macro 'CAL_APPEND'
#define MX_UART_TX_PORT_X CAL_APPEND(MX_UART_TX_PORT_, MX_UART_NUM)
^
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\AVR\AVR_CAL_UART.c:1207:19: note: in expansion of macro 'MX_UART_TX_PORT_X'
FC_CAL_Bit_Low(MX_UART_TX_PORT_X, MX_UART_TX_PIN_X); // Send Start bit
^
Error returned from [avr-gcc.exe]
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\AVR\batchfiles\avra.bat reported error code 0x1