I'm currently trying to change u-boot-fslc (2014-10) to store its environment in SPI flash on my iMX6 platform. Strangely defining the macro to indicate this immediately causes a working u-boot build to suddenly fail to compile.
After defining:
CONFIG_ENV_IS_IN_SPI_FLASH
The compile shows that all sized types are now undefined:
tmp/work/ph069_qx-poky-linux-gnueabi/u-boot-fslc/v2014.10+gitAUTOINC+5fd0b607d0-r0/git/include/ide.h:77:14: error: unknown type name 'uchar'
| void ide_led(uchar led, uchar status);
and many others, u8, u16, BIT_MASK etc. are now all undefined.
Does anyone know why this is or what I must do to correct it?!
Thanks!
Solved! Go to Solution.
OK, the issue was down to including another header that defined CONFIG_ENV_IS_IN_MMC though quite why it causes the type related build failure I have no idea!
OK, the issue was down to including another header that defined CONFIG_ENV_IS_IN_MMC though quite why it causes the type related build failure I have no idea!
I have the same issue. Do you remember what was your missing header?
Have you added SPI support to your board first?
Take a look at include/configs/nitrogen6x.h, which uses CONFIG_ENV_IS_IN_SPI_FLASH and it builds fine.
Thanks for your help!
Yes, I have and in fact I have no problem talking to the flash over SPI from the shell (or even booting from it), it's only when I add environment in SPI flash that issues arise. The build failure appears to be host side, it's tools/* that fail. Though that may just be because of the order of building of course.
/* SPI Flash */
#define CONFIG_CMD_SF
#define CONFIG_CMD_SPI
#define CONFIG_SPI
#define CONFIG_MXC_SPI
#define CONFIG_MXC_ECSPI
#define CONFIG_SPI_FLASH
#define CONFIG_SPI_FLASH_BAR
#define CONFIG_SPI_FLASH_STMICRO
#define CONFIG_SPI_FLASH_SPANSION
#define CONFIG_SF_DEFAULT_BUS 0
#define CONFIG_SF_DEFAULT_SPEED 20000000
#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
#define CONFIG_SYS_MAX_FLASH_SECT 1024
#define CONFIG_SYS_MAX_FLASH_BANKS 1
#undef CONFIG_ENV_IS_IN_SPI_FLASH
#define CONFIG_ENV_IS_IN_SPI_FLASH
#define CONFIG_ENV_SPI_BUS 0
#define CONFIG_ENV_SPI_CS 0
#define CONFIG_ENV_SECT_SIZE (64 * 1024)
#ifdef CONFIG_ENV_OFFSET
#undef CONFIG_ENV_OFFSET
#endif
#define CONFIG_ENV_OFFSET (512 * 1024)
#ifdef CONFIG_ENV_SIZE
#undef CONFIG_ENV_SIZE
#endif
#define CONFIG_ENV_SIZE (64 * 1024)
Try a 'make mrproper' first so that you have a clean environment for the next build.
I've mostly been building from bitbake, doing a clean build each time. Regardless, doing the build from inside the work tree, even clean, gives me the same errors. It feels like some kind of misconfiguration of the host build rather than the cross build, but the host is happy building other applications with no problem.
Try building manually without Yocto:
make mrproper
make <your_target>_defconfig
make
Yes, same issue. Though I should be clearer, the nitrogen builds, my board does not.
It's like the build is confused between host and target builds. If I prevent u-boot from building tools at all I then get build issues relating to "invalid instruction" for those missing types, where the arm/x86 builds have become mixed.