cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

pakc_1330221
New Contributor II

Today I discovered a bug in PSoC Creator 4.2 when using the home folder and using a certain path length in Windows to build your code.

This took a day of my life to figure out what was wrong. I checked the code, project files, compiler and linker settings, like a million times, but that was not the case. It was just the home folder in combination with path length.

It does not happen in other locations other than your home folder.

When does it happen:

  • When your project folder is in your home folder C:\users\{yourname}\folder
  • When the folder length exceeds +-120 characters

Example path in my case (reproducible error):

My project folder (not that very deep to be honest)

c:\Users\paul\Projects\Cypress\BLE-Projects\

When you unpack the 100 days examples in it.... (Still not that much: 127 characters, still far below ~247 of Windows)

c:\Users\paul\Projects\Cypress\BLE-Projects\PSoC-4-BLE-master\100_Projects_in_100_Days\Day020_BLE_UART\UART_to_BLE_peripheral\

Then when you build your project it will end up with a compile error.

pastedImage_6.png

So you keep thinking what have I done wrong. The compiler doesn't complain about path sizes or disk storage issues.

And the error doesn't reveal that much "failed with exit code '1'.

BUT here is the catch, when you put the entire folder in another location than C:\users\{yourname} suddenly it the compile error is gone! Yai!

Even when the path length is even longer than before.

pastedImage_8.png

My conclusion is that there is an issue with the relative path's that are a bit long when building the code. If it are full path's the issue doesn't appear.

arm-none-eabi-gcc.exe -Wl,--start-group -o C:\Users\paul\Projects\Cypress\BLE-Projects\PSoC-4-BLE-master\100_Projects_in_100_Days\Day020_BLE_UART\UART_to_BLE_peripheral\UART_to_BLE_peripheral.cydsn\CortexM0\ARM_GCC_541\Debug\UART_to_BLE_peripheral.elf .\CortexM0\ARM_GCC_541\Debug\main.o .\CortexM0\ARM_GCC_541\Debug\app_Ble.o .\CortexM0\ARM_GCC_541\Debug\app_UART.o .\CortexM0\ARM_GCC_541\Debug\app_LED.o .\CortexM0\ARM_GCC_541\Debug\cyfitter_cfg.o .\CortexM0\ARM_GCC_541\Debug\cymetadata.o .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o .\CortexM0\ARM_GCC_541\Debug\UART_to_BLE_peripheral.a "..\..\..\..\..\..\..\..\Documents\PSoC Creator\4.2\Downloads ( 4.2).cylib\BLE_v3_20\Library\gccCyBLEStack_BLE_SOC_PERIPHERAL.a" -mcpu=cortex-m0 -mthumb -L Generated_Source\PSoC4 -Wl,-Map,.\CortexM0\ARM_GCC_541\Debug/UART_to_BLE_peripheral.map -T Generated_Source\PSoC4\cm0gcc.ld -specs=nano.specs -Wl,--gc-sections -g -ffunction-sections -O0 -ffat-lto-objects -Wl,--end-group

Below the full path:

"c:\Program Files (x86)\Cypress\PSoC Creator\4.2\PSoC Creator\import\gnu\arm\5.4.1\bin\arm-none-eabi-gcc.exe" -Wl,--start-group -o C:\Users\paul\Projects\Cypress\BLE-Projects\PSoC-4-BLE-master\100_Projects_in_100_Days\Day020_BLE_UART\UART_to_BLE_peripheral\UART_to_BLE_peripheral.cydsn\CortexM0\ARM_GCC_541\Debug\UART_to_BLE_peripheral.elf .\CortexM0\ARM_GCC_541\Debug\main.o .\CortexM0\ARM_GCC_541\Debug\app_Ble.o .\CortexM0\ARM_GCC_541\Debug\app_UART.o .\CortexM0\ARM_GCC_541\Debug\app_LED.o .\CortexM0\ARM_GCC_541\Debug\cyfitter_cfg.o .\CortexM0\ARM_GCC_541\Debug\cymetadata.o .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o .\CortexM0\ARM_GCC_541\Debug\UART_to_BLE_peripheral.a "c:\users\paul\Documents\PSoC Creator\4.2\Downloads ( 4.2).cylib\BLE_v3_20\Library\gccCyBLEStack_BLE_SOC_PERIPHERAL.a" -mcpu=cortex-m0 -mthumb -L Generated_Source\PSoC4 -Wl,-Map,.\CortexM0\ARM_GCC_541\Debug/UART_to_BLE_peripheral.map -T Generated_Source\PSoC4\cm0gcc.ld -specs=nano.specs -Wl,--gc-sections -g -ffunction-sections -O0 -ffat-lto-objects -Wl,--end-group

I've executed the above statement from the command-line from the exact path in the project and it compiles without issues. I've modified the relative path to be the full path though.

See attached the log files.

Cheers,

Paul

0 Likes
8 Replies
AnkitaS_51
Employee

Hello Paul,

I created  project at this path as you have instructed:

C:\Users\anks\Projects\Cypress\BLE-Projects\PSoC-4-BLE-master\100_Projects_in_100_Days\Day020_BLE_UART

As you can see the same in this screenshot:

pastedImage_0.png

Then I given a build to the project in PSoC Creator  4.2 (4.2.0.641) after Updating the components. I was able to build the project as shown in this image below:

pastedImage_1.png

Am I missing any steps? I am unable to reproduce the issue on Windows7 System

0 Likes
JoMe_264151
Expert II

As far as I remember there is a limit in win7 for the length of a pathname. And I am quite sure that this could be tuned using a setting in the registry. Too long ago and brain is worn... Think might invetigate in that direction.

Bob

0 Likes
pakc_1330221
New Contributor II

Thanks, bob, I've checked that. The path's stay far below the 247 characters (considering drive and extensions).

If I place it outside the home folder I can use even longer paths and it will build without errors.

But even when the path is too long, I expect that an IDE like PSoC Creator will warn me about this instead of giving me an unclear error message.

0 Likes
pakc_1330221
New Contributor II

Hi Anks,

Thanks for looking into this and trying to reproduce.

1.)

Can you check if your " PSoC Creator" folder is located in \Documents\ :

c:\Users\anks\Documents\PSoC Creator\4.2\Downloads ( 4.2).cylib\ ... --> contains subfolders

Having both 1) above folder and 2) project folder in the user folder will generate a generic path instead of a full path for arm-none-eabi-gcc.exe for the linking proces.

2.)

Can you make a copy of the entire line, so we can compare ? The line looks like this:

arm-none-eabi-gcc.exe -Wl,--start-group -o C:\Users\  ..... (it's quite a long line)

Or just copy and paste the entire output window and put it in a txt file as an attachement.

ps. I'm using Windows 10 pro. Version: 1803, OS Build:  17134.48

Thanks,

Paul

0 Likes
AnkitaS_51
Employee

Yes Paul,  this path has PSoC Creator folder and subfolders within it  in my system:

c:\Users\anks\Documents\PSoC Creator\4.2\Downloads ( 4.2).cylib\ .

I am attaching the build log.

Checking the log provided by you with error , it seems the issue is this as stated "gccCyBLEStack_BLE_SOC_PERIPHERAL.a: No such file or directory"

So, firstly check whether this file gccCyBLEStack_BLE_SOC_PERIPHERAL.a file is present at this path in your system or not

C:\Users\anks\Documents\PSoC Creator\4.2\Downloads ( 4.2).cylib\BLE_v3_XX\BLE_v3_xx\Library

If the .a file is present at this path,still creator is unable to access then it may be a Permission Access issue.

Otherwise,I believe to fix this issue you need to recreate the library project.

#1 delete folder "Downloads ( 4.2).cylib"

#2 Open PSoC Creator 4.2

#3 Tools -> Find new components

#4 Search 'BlueTooth'

#5 Select version BLE component's latest version available(v3_50)

#6 Click 'Install Checked Components'

Now you should see the Downloads ( 4.2).cylib being recreated.

0 Likes
pakc_1330221
New Contributor II

Yess I've got the file (gccCyBLEStack_BLE_SOC_PERIPHERAL.a) and I have all the latest components.

"c:\Users\paul\Documents\PSoC Creator\4.2\Downloads ( 4.2).cylib\BLE_v3_51\Library\gccCyBLEStack_BLE_SOC_PERIPHERAL.a"

And I have another one here:

"c:\Program Files (x86)\Cypress\PSoC Creator\4.2\PSoC Creator\psoc\content\CyComponentLibrary\CyComponentLibrary.cylib\BLE_v3_50\Library\gccCyBLEStack_BLE_SOC_PERIPHERAL.a"

-It is also not a permissions issue. If I shorten the path of the project file it will compile.-

For some reason your generated build script differs from mine.

And then specifically this line:

Yours:

arm-none-eabi-gcc.exe -Wl,--start-group -o C:\Users\anks\Projects\Cypress\BLE-Projects\PSoC-4-BLE-master\100_Projects_in_100_Days\Day020_BLE_UART\UART_to_BLE_peripheral\UART_to_BLE_peripheral_01.cydsn\CortexM0\ARM_GCC_541\Debug\UART_to_BLE_peripheral_01.elf .\CortexM0\ARM_GCC_541\Debug\main.o .\CortexM0\ARM_GCC_541\Debug\app_Ble.o .\CortexM0\ARM_GCC_541\Debug\app_UART.o .\CortexM0\ARM_GCC_541\Debug\app_LED.o .\CortexM0\ARM_GCC_541\Debug\cyfitter_cfg.o .\CortexM0\ARM_GCC_541\Debug\cymetadata.o .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o .\CortexM0\ARM_GCC_541\Debug\UART_to_BLE_peripheral_01.a "C:\Program Files (x86)\Cypress\PSoC Creator\4.2\PSoC Creator\psoc\content\CyComponentLibrary\CyComponentLibrary.cylib\BLE_v3_50\Library\gccCyBLEStack_BLE_SOC_PERIPHERAL.a" -mcpu=cortex-m0 -mthumb -L Generated_Source\PSoC4 -Wl,-Map,.\CortexM0\ARM_GCC_541\Debug/UART_to_BLE_peripheral_01.map -T Generated_Source\PSoC4\cm0gcc.ld -specs=nano.specs -Wl,--gc-sections -g -ffunction-sections -O0 -ffat-lto-objects -Wl,--end-group

Mine:

(For some unclear reason my PSoC Creator applies a relative path).

arm-none-eabi-gcc.exe -Wl,--start-group -o C:\Users\paul\Projects\Cypress\BLE-Projects\PSoC-4-BLE-master\100_Projects_in_100_Days\Day020_BLE_UART\UART_to_BLE_peripheral\UART_to_BLE_peripheral.cydsn\CortexM0\ARM_GCC_541\Debug\UART_to_BLE_peripheral.elf .\CortexM0\ARM_GCC_541\Debug\main.o .\CortexM0\ARM_GCC_541\Debug\app_Ble.o .\CortexM0\ARM_GCC_541\Debug\app_UART.o .\CortexM0\ARM_GCC_541\Debug\app_LED.o .\CortexM0\ARM_GCC_541\Debug\cyfitter_cfg.o .\CortexM0\ARM_GCC_541\Debug\cymetadata.o .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o .\CortexM0\ARM_GCC_541\Debug\UART_to_BLE_peripheral.a "..\..\..\..\..\..\..\..\Documents\PSoC Creator\4.2\Downloads ( 4.2).cylib\BLE_v3_51\Library\gccCyBLEStack_BLE_SOC_PERIPHERAL.a" -mcpu=cortex-m0 -mthumb -L Generated_Source\PSoC4 -Wl,-Map,.\CortexM0\ARM_GCC_541\Debug/UART_to_BLE_peripheral.map -T Generated_Source\PSoC4\cm0gcc.ld -specs=nano.specs -Wl,--gc-sections -g -ffunction-sections -O0 -ffat-lto-objects -Wl,--end-group

It is still a mystery to me why this all happens.

0 Likes
AnkitaS_51
Employee

Can you install the Creator4.2 again at default location

0 Likes
ZiSh_3434191
New Contributor

Thank you Paul.  This was driving me crazy. 

Just moving the project to a different directory worked perfectly.  No need to reinstall or change the build settings.

--zim

0 Likes