PSoC3->PSoC5 funny problem

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

cross mob
lock attach
Attachments are accessible only for community members.
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

a number of times there was a problem:
I'm creating a project for CY8C5868AXI-LP035 - project works without errors.
Then I do: Project-> Device Selector ... CY8C3866AXI-040
after compilation:
Build error: unprintable character 0xEF skipped    main.c    line1
Build error: unprintable character 0xBB skipped    main.c    line1
Build error: unprintable character 0xBF skipped    main.c    line1

   

I had to create main.txt, copy the text from main.c and rename .txt to main.c
Why???

0 Likes
7 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Maybe this might shed some light on the problem -

   

 

   

    

   

          http://www.psocdeveloper.com/forums/viewtopic.php?f=48&t=11266

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

I think there's something else:
I see code \ EF \ BB \ BF at the beginning of main.c

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Probably you opened the file in Notepad (or some other editor). The byte sequence 0xefbbef is the so-called "byte order mark" in UTF8, which is needed for UTF16 file to mark the byte order (endianness). Actually its 0xfeff, but in UTF8 it gets re-encoded. Since switching from PSoC3 to 5 changes the compiler (Keil vs. gcc), it also changes the handling of character encoding. For UTF8 the BOM is not needed.

   

You can try to open the file in Cypress Creator, delete the first line and then re-type it manually. That should remove the BOM. In the future, try to avoid any umlauts in your file, which might cause the editor to switcxh to a Unicode-encoding. And avoid notepad 🙂

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Some more information in Wikipedia: https://en.wikipedia.org/wiki/Byte_order_mark

0 Likes
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

Thank you. Maybe you're right. I'll try not to use other editors.
But I tried to edit main.c (PSoC5) by three editors
WordPad, Notepad, NotePad + +    - error does not occur for PSoC3.
And removing the first row - does not help. The error remains.
If no one but me not had a problem then let's hope that this is the problem of my PC.

   


 

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Windows notepad is known for adding the BOM whenever it thinks it shouds save in UTF8 (which might be the default for all non-english versions of Windows). If changing the first line doesn't help, you probably need to use a hex editor to fix that file (or copy anything except the first part of the file, usually its just comments, to a new file and use that one).

   

The Keil compiler seems to fine in accepting input with a BOM, whereas gcc doesn't like it. And given that its not receommended for UTF8, I cannot fault it for that...

0 Likes
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

   

I often open simultaneously Creator2.2 and Creator3.0 and copy text.

   

However, you explained the problem and no sense to find out details.

   

Thank you.

0 Likes