본문 바로가기

Hop the wag during working

Warning - bad CRC, using default environment

u-boot로딩 시에 "Warning - bad CRC, using default environment"를 자주 마주치곤 한다.

이 문제는 u-boot의 환경변수 저장하는 위치를 config파일에서 CFG_ENV_OFFSET을 define하며 지정하게 되는데 그 곳의 내용이 CRC체크섬에 맞지 않으면 위와 같은 메세지를 뿌리며 config파일에서 지정한 환경변수를 그대로 사용하게 된다.

CRC체크섬이 맞지않는 대부분의 경우는 맨 처음 u-boot를 올렸을 때이다. 즉 CFG_ENV_OFFSET에서 지정한 곳에 기존의 환경변수들이 있는지 체크해보게 되는데 내용이 없으므로 위와 같은 메세지를 뿌려주는 것이다.

u-boot개발 사이트인 www.denx.de에서는 다음과 같이 답변을 하였다.
http://www.denx.de/wiki/DULG/WarningBadCRCUsingDefaultEnvironment
Question: 
I have ported U-Boot to a custom board. It seems to boot OK, but it prints: 
*** Warning - bad CRC, using default environment
Why?
 
Answer: 
Most probably everything is OK. The message is printed because the flash sector or ERPROM containing the environment variables has never been initialized yet. The message will go away as soon as you save the envrionment variables using the saveenv command.
즉, saveenv라는 u-boot command를 이용하여 환경변수들을 저장하면 다음부터는 괜찮다.

하지만 saveenv로도 해결이 되지않을 경우가 있다.
보통 환경변수들은 flash영역에 쓰게 되는데 상용화된 보드들에서는 문제가 없을 지 모르지만 개발 중의 보드들은 아주 드문 경우로 flash의 timing margin등이 맞지 않아 분명히 flash영역에 환경변수가 저장 되어있음에도 bad CRC를 뿌리는 경우가 발생한다.