I try to build the fNET using codewarrior, and I got error:
Description | Resource | Path | Location | Type |
Expected operator, got U | fnet_cpu_config.h | /k60-dspi/Sources/fnet_stack/cpu | line 368 | C/C++ Problem |
And the sentence shows this error is:
#if (FNET_CFG_CPU_TIMER_NUMBER<0)||(FNET_CFG_CPU_TIMER_NUMBER>FNET_CFG_CPU_TIMER_NUMBER_MAX)
#error "FNET_CFG_CPU_TIMER_NUMBER must be from 0 to FNET_CFG_CPU_TIMER_NUMBER_MAX."
#endif
What is even the meaning of this "got U", man.
Please help me for this.
已解决! 转到解答。
Hi,
Following the Andrey message you can change the fNET code.
Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi,
Please can you provide us more information ?
1- What is the development tool used ?
CW for MCU V10.6 (or older version) or KDS ?
2- Do you have installed other tools as KSDK or MQX ?
Do you refer to a specific example ?
which one ?
Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
1. I use CW 10.5
2. I have installed MQX 4.2
I was adding the fNET2.7.5 to my CW project and the error occurs in "fnet_cpu_config.h".
I found that:
If I modified the macro definition
#define FNET_CFG_CPU_TIMER_NUMBER_MAX | (3U) |
to be
#define FNET_CFG_CPU_TIMER_NUMBER_MAX | (3) |
then the compilation is OK.
Or I move the sentence in fnet_cpu_config.h:
#if (FNET_CFG_CPU_TIMER_NUMBER<0)||(FNET_CFG_CPU_TIMER_NUMBER>FNET_CFG_CPU_TIMER_NUMBER_MAX)
#error "FNET_CFG_CPU_TIMER_NUMBER must be from 0 to FNET_CFG_CPU_TIMER_NUMBER_MAX."
#endif
to other header file which is not fNET header file, then the compilation is also OK.
Hi,
It seems the problem is not linked to the fnet_cpu_config.h.
On my side the problem is in the fnet_mk_config.h file.
If I change the the source by:
/**************************************************************************
* Maximum Timer number that is avaiable on the used platform.
******************************************************************************/
////#define FNET_CFG_CPU_TIMER_NUMBER_MAX (3U)
#define FNET_CFG_CPU_TIMER_NUMBER_MAX (3)
I can build the demo project.
I will continue to investigate the problem.
Pascal
Hi,
Following the Andrey message you can change the fNET code.
Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi,
Following the Development team feedback, the fNET code is not following the Assembler tool rules.
under \CW_MCU_v10.6\MCU\Help\PDF\MCU_Kinetis_Assembler.pdf
Unfortunately the 12345U is not supported.
For Decimal it should be 12345 or 12345d.
The 12345U is supported in C language.
under \CW_MCU_v10.6\MCU\Help\PDF\MCU_Kinetis_compiler.pdf
+++++++++++++++++++++++++
14.2.15 Unsuffixed Decimal Literal Values
The following listing shows an example of specifying decimal literal values without a
suffix to specify the literal's type.
Listing: Examples of C99 Unsuffixed Constants
#pragma c99 on // Note: ULONG_MAX == 4294967295
sizeof(4294967295) == sizeof(long long)
sizeof(4294967295u) == sizeof(unsigned long)
#pragma c99 off
sizeof(4294967295) == sizeof(unsigned long)
sizeof(4294967295u) == sizeof(unsigned long)
+++++++++++++++++++++++++
I don't know if the #define FNET_CFG_CPU_TIMER_NUMBER_MAX (3u) definition is used on C module too or on S(asm) module only.
Changing to #define FNET_CFG_CPU_TIMER_NUMBER_MAX (3) could have an impact on C code if the definition is used on C module.
An another solution could be to add a "U" definition:
#define U
On the fNET Example I added the #define U in fnet_comp_asm.h.
Then I can build the example without error.
I report the problem in fNET forum too:
Regards
Pascal
Hi Pascal,
This is issue of CW compiler only.
You can easily fix it by putting "3" instead of "3U", without any impact on functionality.
The fix to be available in the next version of FNET.
Thank you very much for the bug report,
Andrey Butok
Hi,
I've created a short example reproducing the problem.
I've logged it in our bug base under the number ENGR00361536
The Freescale compiler is used for fNET V2.7.5.
I've reproduced the problem under :
MCU V10.6.4 (last version)
fNET V2.8
I recommend you to use the workaround you've found.
I will keep you informed.
Pascal
Hi,
I've created an example using the fnet source code.
This example is a compilation of crt0.s file.
Based on this file I included all code of all include files.
So I've a big crt0.s file reproducing the problem.
I will continue to work on it in order to determine the cause of the issue.
Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi,
I've downloaded the fNET v2.7.5.
Inside the installation there are some examples available under the \FNET\FNET 2.7.5\fnet_demos folder.
Under My CW for MCU V10.6.3 I've tried the demo example \FNET 2.7.5\fnet_demos\mk60n512\boot\cw10.6.
Nothing was aded or removed.
When I build the project I got same error:
E:/Freescale/CW_MCU_v10.6/MCU/ARM_Tools/Command_Line_Tools/mwasmarm|Assembler|Error
(E:\Other_Tools\FNET\FNET 2.7.5\fnet_stack\cpu\fnet_cpu_config.h|368|0|0|12859|0)
=#if (FNET_CFG_CPU_TIMER_NUMBER<0)||(FNET_CFG_CPU_TIMER_NUMBER>FNET_CFG_CPU_TIMER_NUMBER_MAX)
>Expected operator, got U
Problem in the fnet_cpu_config.h file:
#if (FNET_CFG_CPU_TIMER_NUMBER<0)||(FNET_CFG_CPU_TIMER_NUMBER>FNET_CFG_CPU_TIMER_NUMBER_MAX)
#error "FNET_CFG_CPU_TIMER_NUMBER must be from 0 to FNET_CFG_CPU_TIMER_NUMBER_MAX."
#endif
I will investigate the problem.
Keep you informed.
Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi,
Do you refer to FNET Embedded TCP/IP Stack ?
Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Ok.
I will download and install the FNET 2.7.5.
Keep you informed.
Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------