資源簡(jiǎn)介
使用uniflash燒寫(xiě)am335x目前還沒(méi)有一個(gè)詳細(xì)的的教程,不少網(wǎng)友在使用uniflash燒寫(xiě)am335x時(shí)遇到了不少的問(wèn)題,作者最近在自己的板子移植了使用uniflash通過(guò)網(wǎng)口和usb口燒寫(xiě)程序程序的功能,特出此教程。詳細(xì)介紹了使用uniflash通過(guò)網(wǎng)口和usb口燒寫(xiě)程序的流程。包括uboot移植詳細(xì)教程、燒寫(xiě)指導(dǎo)和整個(gè)燒寫(xiě)過(guò)程中用到的所有源碼。

代碼片段和文件信息
/*
?*?Module:?flash_cat_util.c
?*
?*?Description:?This?program?is?used?to?demostrate?concatenate?binary
?*??????????????images.
?*
?*?Copyright?(C)?2013?Texas?Instruments?Incorporated?-?http://www.ti.com/
?*
?*
?*??Redistribution?and?use?in?source?and?binary?forms?with?or?without
?*??modification?are?permitted?provided?that?the?following?conditions
?*??are?met:
?*
?*????Redistributions?of?source?code?must?retain?the?above?copyright
?*????notice?this?list?of?conditions?and?the?following?disclaimer.
?*
?*????Redistributions?in?binary?form?must?reproduce?the?above?copyright
?*????notice?this?list?of?conditions?and?the?following?disclaimer?in?the
?*????documentation?and/or?other?materials?provided?with?the
?*????distribution.
?*
?*????Neither?the?name?of?Texas?Instruments?Incorporated?nor?the?names?of
?*????its?contributors?may?be?used?to?endorse?or?promote?products?derived
?*????from?this?software?without?specific?prior?written?permission.
?*
?*??THIS?SOFTWARE?IS?PROVIDED?BY?THE?COPYRIGHT?HOLDERS?AND?CONTRIBUTORS
?*??“AS?IS“?AND?ANY?EXPRESS?OR?IMPLIED?WARRANTIES?INCLUDING?BUT?NOT
?*??LIMITED?TO?THE?IMPLIED?WARRANTIES?OF?MERCHANTABILITY?AND?FITNESS?FOR
?*??A?PARTICULAR?PURPOSE?ARE?DISCLAIMED.?IN?NO?EVENT?SHALL?THE?COPYRIGHT
?*??OWNER?OR?CONTRIBUTORS?BE?LIABLE?FOR?ANY?DIRECT?INDIRECT?INCIDENTAL
?*??SPECIAL?EXEMPLARY?OR?CONSEQUENTIAL?DAMAGES?(INCLUDING?BUT?NOT
?*??LIMITED?TO?PROCUREMENT?OF?SUBSTITUTE?GOODS?OR?SERVICES;?LOSS?OF?USE
?*??DATA?OR?PROFITS;?OR?BUSINESS?INTERRUPTION)?HOWEVER?CAUSED?AND?ON?ANY
?*??THEORY?OF?LIABILITY?WHETHER?IN?CONTRACT?STRICT?LIABILITY?OR?TORT
?*??(INCLUDING?NEGLIGENCE?OR?OTHERWISE)?ARISING?IN?ANY?WAY?OUT?OF?THE?USE
?*??OF?THIS?SOFTWARE?EVEN?IF?ADVISED?OF?THE?POSSIBILITY?OF?SUCH?DAMAGE.
?*
*/
#include?
#include?
#include?
#include?
#include?
#include?
#define?BLOCK_SIZE?2048
//
//?ofile?-?output?file?expecting?concatenate?the?input?file
//?????????expecting?the?file?to?be?open?and?ready?to?write
//?????????when?function?exits?the?file?will?be?aligned?on
//?????????a?boundary?defined?by?block?size
//
//?info_file?-?contain?offsets?of?files?written?to?ofile?
//?
//?infile_name?-?name?of?the?file?to?read?and?concatenate?
//???????????????on?the?of?ofile.?
//
//
void?cat_file(FILE?*ofile?FILE?*info_file?char?*infile_nameunsigned?long?*offset)
{
char?ch;
FILE?*ifile;
struct?stat?sinfo;
unsigned?long?iloadaddr?len;
int?cntleftoverpadding;
unsigned?char?info_string[256];
printf(“\n???Opening?Input?File?%s?\n“infile_name);
//?Open?the?MLO?input?file.
ifile?=?fopen(infile_name?“rb“);
if?(ifile?==?NULL)?{
printf(“Cannot?open?%s\n“?infile_name);
exit(0);
}
//?Get?file?length.
stat(infile_name?&sinfo);
len?=?sinfo.st_size;
printf(“\n?????len?of?%s?is?%ld?\n“infile_namelen);
for?(i=0;?i fread(&ch?1?1?ifile);
fwrite(&ch?1?1?ofile);
}
leftover?=?len?%?(int)BLOCK_SIZE;
padding??=?(int)BLOCK_SIZE?
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-04-20?16:23??uniflash燒寫(xiě)am335x詳細(xì)教程\
?????文件??????535304??2019-04-20?16:10??uniflash燒寫(xiě)am335x詳細(xì)教程\am335x?uniflash燒寫(xiě)功能移植教程.pdf
?????文件?????2083814??2019-04-20?16:11??uniflash燒寫(xiě)am335x詳細(xì)教程\am335x?uniflash燒寫(xiě)指導(dǎo).pdf
?????文件????????8591??2019-04-20?15:12??uniflash燒寫(xiě)am335x詳細(xì)教程\debrick.txt
?????文件????????5009??2019-04-13?12:30??uniflash燒寫(xiě)am335x詳細(xì)教程\flash_cat_util.c
?????文件?????????994??2019-04-20?15:12??uniflash燒寫(xiě)am335x詳細(xì)教程\mk.sh
?????文件???????87751??2019-01-13?23:35??uniflash燒寫(xiě)am335x詳細(xì)教程\Sitara?Uniflash?Flash?Programming?with?U-Boot.pdf
?????文件?????1040983??2019-01-27?14:09??uniflash燒寫(xiě)am335x詳細(xì)教程\Sitara?Uniflash?Quick?Start?Guide.pdf
評(píng)論
共有 條評(píng)論