I was using grep to search for occurrences of SPI_CR2_DS_2 in the chibios source tree and noticed it was showing many .h files as being "binary" and just stating that it found a match rather than printing the line concerned.
If grep detects control characters in a file it does this , having concluded that it is not reading a text file.
It did this on a whole host of .h files : eg.
community/testhal/STM32/STM32F4xx/EICU/os/ext/CMSIS/ST/stm32f091xc.h
iconv utility reveals the line in the initial part of each file throwing the problem:
Code: Select all
/**
******************************************************************************
* @file stm32f091xc.h
* @author MCD Application Team
* @version V2.2.2
* @date 26-June-2015
* @brief CMSIS STM32F091xC devices Peripheral Access Layer Header File.
*
* This file contains:
* - Data structures and the address mapping for all peripherals
* - Peripheral's registers declarations and bits definition
* - Macros to access peripheraliconv:[b] illegal input sequence at position 494[/b]
So just after "Macros to access peripherali" there is an odd Non-ISO character. Since this header section is common to all headers for each arch, this is the same everywhere.
If I edit the file I see " s " at this position , deleting the char preceding the S fixes the problem.
The files affected are:
Code: Select all
Binary file os/ext/CMSIS/ST/stm32f030x6.h matches
Binary file os/ext/CMSIS/ST/stm32f378xx.h matches
Binary file os/ext/CMSIS/ST/stm32f031x6.h matches
Binary file os/ext/CMSIS/ST/stm32l486xx.h matches
Binary file os/ext/CMSIS/ST/stm32f071xb.h matches
Binary file os/ext/CMSIS/ST/stm32f078xx.h matches
Binary file os/ext/CMSIS/ST/stm32f038xx.h matches
Binary file os/ext/CMSIS/ST/stm32f051x8.h matches
Binary file os/ext/CMSIS/ST/stm32l471xx.h matches
Binary file os/ext/CMSIS/ST/stm32f042x6.h matches
Binary file os/ext/CMSIS/ST/stm32f301x8.h matches
Binary file os/ext/CMSIS/ST/stm32f058xx.h matches
Binary file os/ext/CMSIS/ST/stm32f358xx.h matches
Binary file os/ext/CMSIS/ST/stm32l475xx.h matches
Binary file os/ext/CMSIS/ST/stm32f030x8.h matches
Binary file os/ext/CMSIS/ST/stm32f756xx.h matches
Binary file os/ext/CMSIS/ST/stm32f303x8.h matches
Binary file os/ext/CMSIS/ST/stm32f302xc.h matches
Binary file os/ext/CMSIS/ST/stm32f746xx.h matches
Binary file os/ext/CMSIS/ST/stm32f373xc.h matches
Binary file os/ext/CMSIS/ST/stm32f303xc.h matches
Binary file os/ext/CMSIS/ST/stm32f334x8.h matches
Binary file os/ext/CMSIS/ST/stm32l485xx.h matches
Binary file os/ext/CMSIS/ST/stm32l476xx.h matches
Binary file os/ext/CMSIS/ST/stm32f070xb.h matches
Binary file os/ext/CMSIS/ST/stm32f048xx.h matches
Binary file os/ext/CMSIS/ST/stm32f072xb.h matches
Binary file os/ext/CMSIS/ST/stm32f745xx.h matches
Binary file os/ext/CMSIS/ST/stm32f302x8.h matches
Binary file os/ext/CMSIS/ST/stm32f328xx.h matches
Binary file os/ext/CMSIS/ST/stm32f030xc.h matches
Binary file os/ext/CMSIS/ST/stm32f070x6.h matches
Binary file os/ext/CMSIS/ST/stm32f098xx.h matches
Binary file os/ext/CMSIS/ST/stm32f318xx.h matches
Also the same files in : community/testhal/STM32/STM32F4xx/EICU/os/ext/
It seems that some odd char has got into this header section had has been copied in a template to all versions.
It is the character before the "s" that is giving problems. I'm guessing it is an apostrophe in someone's locale / editor but it is non-standard and is causing basic linux / unix utilities to barf.
It looks like this may originate in ST's CMSIS code but it would be nice to fix it Chibios tree.