Bug in PSoC Creator 4.2 due to path length and using home folder (your code doesn't build)

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

cross mob
pakc_1330221
Level 2
Level 2
First like received Welcome!

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