HelTecAutomation / CubeCell-Arduino

Heltec CubeCell Series (based on ASR6501, ASR6502 chip) Arduino support.
247 stars 138 forks source link

.S files: no preprocessing #124

Closed eiten closed 4 years ago

eiten commented 4 years ago

code like #ifdef __ASR6501__ are not processed in assembler files. Please change this lines in platform txt to

compiler.S.cmd=arm-none-eabi-gcc
compiler.S.flags=-mcpu=cortex-m0plus -mthumb -c -x ass Iembler-with-cpp -g -w -gdwarf-2 "-I{compiler.sdk.path}/projects/PSoC4"

to fix the issue. It's the way it's done in other cortex based Arduino implementations

Heltec-Aaron-Lee commented 4 years ago

Did you tested that? I tried as yours, error occurred. 图片

eiten commented 4 years ago

My bad! Sorry, that was a copy paste error! It should read

compiler.S.cmd=arm-none-eabi-gcc
compiler.S.flags=-mcpu=cortex-m0plus -mthumb -c -x assembler-with-cpp -g -w -gdwarf-2 "-I{compiler.sdk.path}/projects/PSoC4"
Heltec-Aaron-Lee commented 4 years ago

Indeed the compiler.S.cmd=arm-none-eabi-as refer from the Cypress original example, the .S files are automatically generated by IDE. So we just keep this part the same as Cypress one.

We are not very professional in compilation principle, can you please tell me why?

eiten commented 4 years ago

Of course, for example if you look at this file (I am writing a CubeCell hal for the MySensors library). if you use arm-none-eabi-as in stead of arm-none-eabi-gcc, it will crash on line 32 because -as does not process the preprocessor directives in lines 21 and 28.

eiten commented 4 years ago

Btw, it's the standard in cortex arduino frameworks, for example the Adafruit_nRF52 implementation, SAM3X/SAMd21, XMC1100 , cc3200 or STM32. In fact, I never came across a Cortex where this is solved different.

Heltec-Aaron-Lee commented 4 years ago

Thank you for your hint. I had fixed that.