Blackfin Uclinux UserGuide
Blackfin Uclinux UserGuide
Tinyboards maximumperformanceatminimumsize
Contact BluetechnixMechatronischeSystemeGmbH Waidhausenstr.3/19 A1140Vienna AUSTRIA/EUROPE [email protected] http://www.bluetechnix.com DocumentNo.:099011001 Version6 Date:20090902
BlackfinuClinuxUserGuide
Page2
Tinyboards maximumperformanceatminimumsize
Table of Contents
1 Introduction.........................................................................................................................8 2 WheretogetInformationandHelp....................................................................................9 3 SupportDVD......................................................................................................................10 3.1 3.2 Content.......................................................................................................................10 VMWareimagesetup.................................................................................................10 Installpackages....................................................................................................10 Usefulhints ..........................................................................................................11 . SetupwithoutVMWareimage ............................................................................11 .
4 DevelopmentEnvironmentSetup.....................................................................................13 5 SoftwarePackages.............................................................................................................14 6 DevelopmentTools ...........................................................................................................15 . 6.1 6.2 gnICEJTAG..................................................................................................................15 PEEDIJTAG..................................................................................................................16 Resources.............................................................................................................16 Updatingtheconfigurationfile............................................................................16 Updatingthefirmware.........................................................................................16 DebuggingtheuClinuxkernel..............................................................................17 DebugginguClinuxapplications...........................................................................17
ICEbearJTAG...............................................................................................................17
7 BlackfinuClinuxToolChain...............................................................................................19 8 TheUBootbootloader.....................................................................................................20 8.1 8.2 8.3 8.4 8.5 8.6 8.7 FlashingtheUBoot....................................................................................................20 . UBootenvironment...................................................................................................20 LoadingfilesontotheCoreModule...........................................................................21 BuildingUBootfromsource......................................................................................22 UpgradingtheUBoot.................................................................................................23 BootingUBootfromUART.........................................................................................23 ProgrammingauClinuximagetoflashmemory........................................................23 Page3
BlackfinuClinuxUserGuide
Tinyboards maximumperformanceatminimumsize BootingauClinuxImage.............................................................................................24 Firstimpressionwithprecompiledimages ...............................................................26 . CompilingyourownuClinuxImage............................................................................26 DownloadingtheSourceCode.............................................................................26 ConfiguringtheKernelandUserSpaceApplications...........................................27 CompilinguClinux.................................................................................................27 SpecialconsiderationsforCMBF548..................................................................28 SD/MMCcard.......................................................................................................28 USBsupport(CMBF527,CMBF548)...................................................................28
9 BlackfinuClinux.................................................................................................................26
ConfigurationofonboardComponents....................................................................28
DocumentRevisionHistory............................................................................................30
A ListofFiguresandTables..................................................................................................31
BlackfinuClinuxUserGuide
Page4
Tinyboards maximumperformanceatminimumsize
Edition200702 BluetechnixMechatronischeSystemeGmbH2007 AllRightsReserved. Theinformationhereinisgiventodescribecertaincomponentsandshallnotbeconsidered asaguaranteeofcharacteristics. Termsofdeliveryandrightsoftechnicalchangereserved. We hereby disclaim any warranties, including but not limited to warranties of non infringement,regardingcircuits,descriptionsandchartsstatedherein. Bluetechnixmakesandyoureceivenowarrantiesorconditions,express,implied,statutory orinanycommunicationwithyou.Bluetechnixspecificallydisclaimsanyimpliedwarrantyof merchantabilityorfitnessforaparticularpurpose. Bluetechnixtakesnoliabilityforanydamagesanderrorscausingoftheusageofthisboard. Theuserofthisboardisresponsiblebyhimselfforthefunctionalityofhisapplication.Heis allowedtousetheboardonlyifhehasthequalification.Moreinformationisfoundinthe GeneralTermsandConditions(AGB). Information For further information on technology, delivery terms and conditions and prices please contactBluetechnix(http://www.bluetechnix.com). Warnings Duetotechnicalrequirementscomponentsmaycontaindangeroussubstances. The Core Modules and development systems contain ESD (electrostatic discharge) sensitive devices. Electro static charges readily accumulate on thehumanbodyandequipmentand can discharge without detection. Permanent damage may occur on devices subjected to highenergy discharges. Proper ESD precautions are recommended to avoid performance degradation or loss of functionality. Unused Core Modules and Development Boards should be stored in the protective shipping package.
BlackfinuClinuxUserGuide
Page5
Tinyboards maximumperformanceatminimumsize
BLACKFIN Products
CoreModules: CMBF533: Blackfin Processor Module powered by Analog Devices single core ADSPBF533processor;upto600MHz,32MBRAM,2MBFlash,120 pinexpansionconnectorandasizeof36.5x31.5mm Blackfin Processor Module powered by Analog Devices single core ADSPBF537 processor; up to 600MHz, 32MB RAM, 4MB Flash, integrated TP10/100 Ethernet physical transceiver, 120 pin expansionconnectorandasizeof36.5x31.5mm Blackfin Processor Module powered by Analog Devices single core ADSPBF537 processor; up to 600MHz, 32MB RAM, 4MB Flash, integratedUSB2.0Device,120pinexpansionconnectorandasizeof 36.5x31.5mm(willbereplacedbyCMBF527). Blackfin Processor Module powered by Analog Devices single core ADSPBF537 processor; up to 500MHz, 32MB RAM, 8MB Flash, 28x28mm, 120 pin expansion connector, Ball Grid Array or Border Pads for reflow soldering, industrial temperature range 40C to +85C. Blackfin Processor Module powered by Analog Devices dual core ADSPBF561 processor; up to 2x 600MHz, 64MB RAM, 8MB Flash, 120pinexpansionconnectorandasizeof36.5x31.5mm. The new Blackfin Processor Module is powered by Analog Devices singlecoreADSPBF527processor;keyfeaturesareUSBOTG2.0and Ethernet. The 2x60 pin expansion connectors are backwards compatiblewithotherCoreModules. The new Blackfin Processor Module is powered by Analog Devices single core ADSPBF548 processor; key features are 64MB DDR SD RAM2x100pinexpansionconnectors.
CMBF537E:
CMBF537U:
TCMBF537:
CMBF561:
CMBF527:
CMBF548:
DevelopmentBoards: EVALBF5xx: Low cost Blackfin processor Evaluation Board with one socket for any Bluetechnix Blackfin Core Module. Additional peripherals are available,suchasanSDCard. GetreadytoprogramanddebugBluetechnixCoreModuleswiththis tinydevelopmentplatformincludingaUSBBasedDebugAgent.The Page6
DEVBF5xxDALite:
BlackfinuClinuxUserGuide
DEVBF5xxFPGA:
Blackfin Development Board with two sockets for any combination ofBlackfinCoreModules.Additionalperipheralsareavailable,such as SDCard, Ethernet, USB host, multiport JTAG including a USB basedDebugAgent,connectorforanLCDTFTDisplayandconnector foradigitalcamerasystem.AlargeonboardSPARTAN3FPGAand Soft IPs make this board the most flexible Blackfin development platformseverdeveloped. Get ready to program and debug Bluetechnix CMBF548 Core ModulewiththistinydevelopmentplatformincludingaUSBBased Debug Agent. The DEVBF548DALite is a low cost starter developmentsystemincludingVDSP++EvaluationSoftwareLicense. ThefollowingExtenderBoardsareavailable:EXTBF5xxAudio,EXT BF5xxVideo, EXTBF5xxCamera, EXTBF5xxExp, EXTBF5xxETH USB, EXTBF5xxAD/DA. Additional boards based on customer requestarealsoavailable.
DEVBF548DALite:
EXTBoards:
SoftwareSupport: BLACKSheep: TheBLACKSheepVDKisamultithreadedframeworkfortheBlackfin processor family from Analog Devices that includes driver support foravarietyofhardwareextensions.ItisbasedontherealtimeVDK kernelincludedwithintheVDSP++developmentenvironment. LabVIEW embedded support for the CMBF537E, CMBF537U and TCMBF537CoreModulesisbasedupontheBLACKSheepVDKdriver Framework. All the Core Modules are fully supported by uClinux. The required boot loader and uClinux can be downloaded from: http://blackfin.uClinux.org.
LabVIEW:
uClinux:
BlackfinuClinuxUserGuide
Page7
Tinyboards maximumperformanceatminimumsize
1 Introduction
This document is intended to provide help for starting development with uClinux on BluetechnixBlackfinbasedTinyboards.BluetechnixprovidesasetofhighsophisticatedCore Modules. For all Blackfin based Core Modules (CMBF527, CMBF533, CMBF537E, CM BF537U, TCMBF537, CMBF548, CMBF561) uClinux support is available. In addition, Bluetechnix provides development tools (gnICE JTAG, PEEDIJTAG, ICEbear JTAG) and DevelopmentBoards(EVALBF5xx,DEVBF5xxDALite,etc.)andExtenderboards(EXTBF5xx Audio,EXTBF5xxCam,EXTBF5xxUSBETH2,etc.).Pleasevisitwww.bluetechnix.comforthe completelist. In the following, we will introduce the development environment setup, the required Software packages and the development tools. A short intro to the Blackfin uClinux tool chain,theUBootbootloaderanduClinuxisgiven.
BlackfinuClinuxUserGuide
Page8
Tinyboards maximumperformanceatminimumsize
BlackfinuClinuxUserGuide
Page9
Tinyboards maximumperformanceatminimumsize
3 Support DVD
3.1 Content
ThesupportDVDcontainsthefollowingfiles:
DevEnvVMWareImage.zip:ArchivecontainingaVMWareimagewiththeBluetechnix
DevelopmentEnvironmentforBlackfinuClinuxdevelopment. Toolchain2009R1.tar.bz2:Binarytoolchain,2009R1branch U-Boot2009.06.tar.bz2:UBootsources(SVNcheckout),trunk/2009.06branch uClinux-dist-2009R1.tar.bz2: uClinux distribution and Kernel sources (SVN checkout),2009R1branch Bluetechnix_Images/:PrecompiledimagesforallBluetechnixCoreModules Blackfin_uClinux_UserGuide.pdf:Thisfile
DoubleclicktheDVDicononthedesktop.Thiswillopenafilemanagerwindowandmount the DVD automatically to /media/cdrom1. Now open a terminal. In your home directory (/home/blt)typethefollowingcommandstouncompressthepackages:
tar -xjf /media/cdrom1/Toolchain2009R1.tar.bz2 tar -xjf /media/cdrom1/U-Boot2009.06.tar.bz2 tar -xjf /media/cdrom1/uClinux-dist-2009R1.tar.bz2
BlackfinuClinuxUserGuide Page10
Tinyboards maximumperformanceatminimumsize
Youwillenduphavingthefollowingdirectoriesinyourhomedirectory: toolchain2009R1/containsthebinarytoolchain.Toaddthetoolchainpathtothe $PATHenvironmentvariable,anentrywasalreadyaddedtothe~/.bashrcfile.Ifyou wish to have another directory layout or you want to use another tool chain, you havetomodifythisentry. u-boot-2009.06/ contains the UBoot source code. It was checked out from SVN and patches for our Core Modules are already applied. In this directory, you may executesvn updatetogetthelatestupdatesfromtheBlackfinuClinuxSVN. uclinux-2009R1/containstheuClinuxdistribution,includingtheLinuxkernel.Inthis directory, you may execute svn update to get the latest updates from Blackfin uClinux SVN (2009R1 branch). The kernel sources are in the linux-2.6.x/ subdirectory. 3.2.2 Useful hints Toreleasethemouseandkeyboardfocus,pressCtrl+Altkeys. Incaseyouwanttomodifytheinstallation,youneedthepasswordofthedefaultuser: User: blt Password: blt To install Linux applications, you may use the Synaptic Package Manager that comes with Xubuntu.ItiscontainedintheApplicationsmenu,sectionSystem. 3.2.3 Setup without VMWare image IfyoudonthavetheneedtoworkwiththeVMWareimage,youcansimplyunpackthetool chain,uClinuxandUBootpackagestoaplaceofyourchoice. Then add the following lines to the ~/.bashrc file. The tool chain path will then automaticallybeaddedtothe$PATHenvironmentvariableeachtimeyoulogin.
# BFIN UCLINUX TOOLCHAIN TOOLCHAINDIR=/home/blt/toolchain2009R1 export PATH=$PATH:$TOOLCHAINDIR/bfin-uclinux/bin:$TOOLCHAINDIR/bfinelf/bin:$TOOLCHAINDIR/bfin-linux-uclibc/bin
3.3 Kermit
Kermitisaserialterminalprogram.WeuseittocommunicatewiththeCoreModulesovera USBcablethatisconnectedtotheUARTtoUSBconverterchipontheDev/Evalboard.See http://docs.blackfin.uclinux.org/doku.php?id=terminal_programs for more information aboutserialterminals. ToaccesstheserialterminalwithinVMWarePlayer,attachtheUSBcablefirsttoyourPC. Most Linux distributions detect the UARTtoUSB converter automatically. (See the BlackfinuClinuxUserGuide Page11
Tinyboards maximumperformanceatminimumsize
HardwareUserManualofyourEval/DevBF5xxboardhowtoinstalladriverfortheUARTto USBconverterchipinWindows.)IntheVMWarePlayermenu,click Devices USBtoUARTBridgeController Connect toconnecttheserialcabletothevirtualmachine. For your convenience, a shell script was installed that automatically searches for the last serial connection that was detected and opens the Kermit program with the correct parameters.Intheterminal,type(fromthehomedirectory)
stuff/serialterminal
Afterwards,restarttheNFSserverwiththecommand
/etc/init.d/nfs-kernel-server restart
BlackfinuClinuxUserGuide
Page12
Tinyboards maximumperformanceatminimumsize
FortheconnectiontothepromptsofUBootanduClinux,aterminalprogramisneeded.We recommend Kermit. It is part of most Linux distributions the package is usually named ckermit. A quick introduction to terminal programs is given on the web site http://docs.blackfin.uclinux.org/doku.php?id=terminal_programs&s=kermit Thebasicconnectionparametersforterminalprogramsareasfollows: Baudrate 115200 Databits 8 Stopbits 1 Flowcontrol none Parity none If you use Kermit, it is recommended to create the settings file .kermrc in your home directorywiththefollowinglines:
set set set set set set set set set set line /dev/ttyUSB0 speed 115200 carrier-watch off flow-control none prefixing all parity none stop-bits 1 modem none file type bin file name lit
For fast transfer of files (e.g., uClinux images) to the target hardware via Ethernet, it is recommendedtoinstallaTFTPserveronthedevelopmentworkstation.Thisrequireseither aCoreModulewithonboardEthernetcapabilityoracertainBaseorExtenderboard.Please refer to your Linux distributions package database for appropriate TFTP packages. Also, thereisanentryintheBluetechnixuClinuxWikiaboutinstallingaTFTPserver: http://docs.blackfin.uclinux.org/doku.php?id=setting_up_a_tftp_server
BlackfinuClinuxUserGuide
Page13
Tinyboards maximumperformanceatminimumsize
5 Software Packages
ThethreebasicsoftwarepackagesneededforuClinuxdevelopmentare: BlackfinuClinuxdistribution,includesuClinuxkernel UBootbootloader Toolchainforcrosscompiling These software packages are available for download at the Blackfin uClinux web site http://blackfin.uclinux.org. Please follow the links on this page. Each project has a Files section where releases can be downloaded from. Furthermore, SVN access is available via theSVNsectiontogetthelatestsnapshotofeach. Youcaneitherworkwithreleasesofthesesoftwarepackages,orwiththecurrentsources from SVN. Releases are naturally stable and well tested. The advantage of SVN sources is that you will get the newest features and drivers from the uClinux kernel and the newest applications.Butpleasekeepinmindthatthisistheplacewheredevelopmentisgoingon! For the tool chain, daily generated precompiled SVN snapshots (nightly snapshots) are available. PrecompiledimagesforUBootanduClinuxaswellasspecificpatchesfortheBluetechnix Core Modules can be downloaded from the Bluetechnix project site at http://blackfin.uclinux.org/gf/project/bluetechnix/frs.
BlackfinuClinuxUserGuide
Page14
Tinyboards maximumperformanceatminimumsize
6 Development Tools
The Bluetechnix Core Modules are either shipped with preflashed BLACKSheep software (forfurtherdetailspleaseseetheBLACKSheepdocumentation)orwithUBootanduClinux. Both provide a boot loader. Anyway, if they are corrupted or not available at your target hardware,youwillneedaJTAGprogrammerforflashinguBootand/oruClinux.Besidesthe HPUSBICE from Analog Devices, flashing and/or debugging Bluetechnix Core Modules is supported by three JTAG devices, the gnICE from Analog Devices, the PEEDI from Ronetix, andtheICEBearfromSection5. Certain Core Modules allow for booting the UBoot from UART: CMBF527, (T)CMBF537x, CMBF548.Forthese,aJTAGdeviceisnotrequiredifthesoftwarewasdeleted/corrupted.
BlackfinuClinuxUserGuide
Page15
Tinyboards maximumperformanceatminimumsize
TomakeabackupofPEEDIscurrentconfigurationfile,type
transfer eep://bf537.cfg tftp://192.168.1.1/bf537.cfg
atthePEEDIprompt.ThiswillcopyittoyourTFTPserversrootdirectory. ToupdatetheconfigurationfilefromaTFTPserver,type
config tftp://192.168.1.1/bf537.cfg
at the RedBoot prompt (Refer to section 6.2.3 for instructions how to reach the RedBoot prompt).ThenpresstheResetbuttononPEEDI. 6.2.3 Updating the firmware First,youhavetogettotheRedBootpromptofPEEDI: Pressandholdthetwobuttonsonthefrontside. PresstheResetbuttononthebacksideonce. Waitawhileandreleasethetwobuttonsonthefrontsideafterwards.
BlackfinuClinuxUserGuide
Page16
Tinyboards maximumperformanceatminimumsize
Now you can connect to PEEDI with Telnet. The RedBoot prompt appears. Type the command
update tftp://192.168.1.1/firmware.bin
to start the update process (assuming that the file firmware.bin in your TFTP directory containsthenewfirmware). 6.2.4 Debugging the uClinux kernel FollowtheinstructionsintheReadmefileonhowtocompilethekernel.AftertheuClinux imageisprogrammedintoflashmemory,startGDBwiththecommand
bfin-uclinux-gdb vmlinux
NowtypelsontheserialconsolerunninguClinux.Thebreakpointwillbehit.
6.2.5 Debugging uClinux applications Because of some bugs in bfinuclinuxgdb as mentioned in the Readme file, it is recommendedtousegdbserverfordebugginguClinuxapplicationsasdescribedat http://docs.blackfin.uclinux.org/doku.php?id=debuggers.
BlackfinuClinuxUserGuide
Page18
Tinyboards maximumperformanceatminimumsize
For your convenience, it is recommended to add these lines to the ~/.bashrc file of your homedirectory,sothatthesesettingswillareautomaticallybedoneeachtimeyoulogin.
Note! There are dependencies between Linux distribution, kernel and the tool chain. If youusedifferentversionsofeach(e.g.anoldreleaseoftheLinuxkernel,butthe latesttoolchainfromSVN),youmayexperienceproblems.
BlackfinuClinuxUserGuide
Page19
Tinyboards maximumperformanceatminimumsize
Table81:UBootimagetypesforCoreModules Table 81 lists all Core Modules and the file type of UBoot that must be used for flash programming. Please refer to the BLACKSheep Command Reference (available on the Bluetechnix web site,http://www.bluetechnix.at)forinstructionshowtoprogramUBootwithBLACKSheep. It is recommended to first program UBoot as application and to test it before replacing BLACKSheep with UBoot, because if the UBoot does not work and you have already removedtheBLACKSheep,youwouldneedaJTAGflashprogrammer. After you have replaced BLACKSheep with UBoot, you have to change the boot mode of thoseCoreModulesthatexecutetheu-boot.binfile.PleaserefertotheHardwareUser Manual(availableontheBluetechnixwebsite)ofyourCoreModulefortheappropriateDIP switchsettings.
Note! DonotusethesaveenvcommandofUBootifyouprogrammeditasapplication withBLACKSheep.ThiscommandsavestheUBootenvironmentvariablestoflash memoryandmayoverwritepartsofBLACKSheep,makingitunusable.
Tinyboards maximumperformanceatminimumsize
Thereare3commandstomodifythesevariables: 1. printenvPrintsallenvironmentvariablestotheterminal. 2. setenv [name] [value]Createsanewvariableoroverwritesanexistingone. Note that, if special characters are used in the value, they have to be prefixed with\. 3. saveenvSavesthecurrentenvironmentvariablestoflashmemorysothatthey arerestoredafterareset. Task1:SetIPaddressesoftheCoreModuleandoftheTFTPserver
setenv ipaddr 192.168.5.7 setenv serverip 192.168.5.1
Task2:SettheMACaddressfortheEthernetdevice
setenv ethaddr 02:80:ad:20:31:e8
Task3:SetthekernelbootargumentsforbootingwithJFFS2filesystem
setenv bootargs root=/dev/mtdblock2 rootfstype=jffs2 rw clkin_hz=25000000 earlyprintk=serial,uart0,115200 console=ttyBF0,115200 setenv bootargs root=/dev/mtdblock2 rootfstype=jffs2 rw clkin_hz=30000000 earlyprintk=serial,uart0,115200 console=ttyBF0,115200 (forCMBF537Uonly)
Task4:Runascript
setenv flashboot flread 0x20040000 0x1000000 0x280000\; bootm 0x1000000 (definethescript) run flashboot (executethescript)
Task5:ModifythebootcommandofUBoot
setenv bootcmd run flashboot(UBootwillruntheflashbootcommandat
boot)
Tinyboards maximumperformanceatminimumsize
IfnoEthernetaccessisavailable,filescanbetransferredovertheserialconnection.Please notethatthetransferrateisveryslow.Theprocedureisdescribedfortheterminalprogram Kermit: 1. TypeloadbattheUBootprompt. 2. SwitchtotheKermitpromptbypressingCtrl\followedbyc. 3. Typesend [file name]tostartthetransfer.Thestatusisshownduringthedata transfer. 4. Afterthetransferiscomplete,typectoreturntotheUBootprompt.Thefilesize isprintedtotheterminal.
Note! Ifthetransferfailswithanerror,tryusing2stopbitsinsteadof1.InKermit,you can do this by typing set stopbits 2 at the Kermit prompt. (This behavior was observedwithCMBF561coremodules.)
intheUBootsourcedirectory.ToadaptUBoottoyourspecificneeds(core/systemclock, environment variables, network settings, etc.), please edit the configuration file correspondingtoyourCoreModule: CMBF527: CMBF533: CMBF537E: CMBF537U: TCMBF537: CMBF548: CMBF561:
u-boot-2009.06/include/configs/cm-bf527.h u-boot-2009.06/include/configs/cm-bf533.h u-boot-2009.06/include/configs/cm-bf537e.h u-boot-2009.06/include/configs/cm-bf537u.h u-boot-2009.06/include/configs/tcm-bf537.h u-boot-2009.06/include/configs/cm-bf548.h u-boot-2009.06/include/configs/cm-bf561.h
If you want to build an UBoot image for UART boot, you have to change the CONFIG_BFIN_BOOT_MODEsettinginthisconfigurationfiletoBFIN_BOOT_UART. Next,type make,followedbythenameoftheCoreModule(equaltotheheaderfilenames above).Forexample,type
make cm-bf537e
tobuildUBootfortheCMBF537ECoreModule. Several files named u-boot.* are created, whereof u-boot.bin and u-boot.ldr respectively(seeTable81)isthebinaryimagewhichisusedtoprogramUBootintoflash memory.
BlackfinuClinuxUserGuide
Page22
Tinyboards maximumperformanceatminimumsize
IfyouwanttocreateanIntelHEXimagethatiscompatibletoAnalogDevicesVisualDSP++ flashprogrammer,youneedtotypethefollowingcommand:
bfin-uclinux-objcopy I binary O ihex u-boot.bin u-boot.hex or bfin-uclinux-objcopy I binary O ihex u-boot.ldr u-boot.hex
attheUBootprompttoexecutethenewUBoot.Ifitboots,thetestwassuccessfulandyou can program the new image to flash memory. Reset the device, load u-boot.bin or uboot.ldrrespectivelyintoRAM,andtypethefollowingcommandsattheUBootprompt:
protect off 0x20000000 +$(filesize) erase 0x20000000 +$(filesize) cp.b 0x1000000 0x20000000 $(filesize) cmp.b 0x1000000 0x20000000 $(filesize)
Aftertheprogrammingprocessisfinished,youcanresetyourdevice.ThenewUBootisnow installed.
Tinyboards maximumperformanceatminimumsize
vmImage: contains the compressed Linux kernel. You have to program a root file
Iftheflashmemoryisnotempty,youhavetoeraseitfirst.Theerasecommandneedstwo arguments: The first is the start address of flash memory (0x20000000), the second is the memorysize.Toeraseallsectorsinflashmemory(includingUBoot),type:
protect off all erase all
ToeraseasmuchmemoryasisneededbyafilethatwasloadedintoRAMpreviously,type:
protect off 0x20040000 +$(filesize) erase 0x20040000 +$(filesize)
TheUBootbootloaderrequires256Kbytesofflashmemory.So,storingauClinuximageat address0x20040000isagoodchoice. Aftererasing,theimageistransferredtoflashmemorywiththecp.bcommandwhichneeds three arguments: The first one is the copyfrom address, it is usually 0x1000000 (RAM). Thesecondoneisthecopytoaddress.ThedefaultforourCoreModulesis0x20040000. Thethirdoneisthelength.Thecommandforprogrammingisasfollows:
cp.b 0x1000000 0x20040000 $(filesize) cp.b 0x1000000 0x20040000 $(filesize)
(nowloadtherootfs.jffs2filetoRAM)
cp.b 0x1000000 0x20140000 $(filesize)
To verify the written data, you can use the cmp.b command which takes the same arguments:
cmp.b 0x1000000 0x20040000 $(filesize)
Note!
On Core Modules that use GPIOs for flash addressing, the compare command cmp.b does only work for the lowest 2 MBytes of flash memory, because cmp.b andsimilarcommandsarestrictlymemorymappedanddonotcareaboutGPIOs.
Tinyboards maximumperformanceatminimumsize
CMBF527,CMBF537E,CMBF537U,TCMBF537:
flread 0x20040000 0x1000000 0x300000 bootm 0x1000000
CMBF533,CMBF548,CMBF561:
bootm 0x20040000
Thefirstargumentisthesourceaddress,thesecondthedestinationaddress,andthethird theimagelength.Itdoesnotmatterifthelengthisgreaterthantheactualimagesize.Ifyou knowtheexactlengthofyourimage,youmaystoreitinthe filesizeUBootenvironment variableandreplacethefixedlength0x300000intheaboveexamplewith$(filesize).Ifa fileisloadedinUBoot,UBootsetsthisvariableautomaticallytothefilesizeofthelastfile transferred.Ifyousavetheenvironmentafterwards,thevariablecontentwillberestoredat eachboot. ThedefaultofUBootistobootauImagestoredat0x20040000inflashmemory.Forusinga JFFS2filesystem,modificationstotheUBootenvironmentarerequired.Seechapter8.2for ashortreference.
BlackfinuClinuxUserGuide
Page25
Tinyboards maximumperformanceatminimumsize
9 Blackfin uClinux
The uClinux distribution for the Blackfin processor contains the uClinux kernel and lots of tools and applications known from the Linux world. It is available from the uClinux distributionprojectonthefollowingwebsite: http://blackfin.uclinux.org To become familiar with uClinux, reading through the introduction of the documentation WikiofBlackfinuClinuxisagoodidea.Itisavailableon http://docs.blackfin.uclinux.org.
BlackfinuClinuxUserGuide
Page26
Tinyboards maximumperformanceatminimumsize
Inthefirstconfigurationdialog,youmustchoosethevendorandtheproductforwhichyou want to compile uClinux. Alwayschoose Bluetechnix as the vendor and selectyour Core Module in the products option. For example, if you have a CMBF537E Core Module, you havetomakethefollowingsettings:
Vendor/Product Selection ---> --- Select the Vendor you wish to target (Bluetechnix) Vendor --- Select the Product you wish to target (CM-BF537E) Bluetechnix Products
For further configuration dialogs for the kernel configuration and for user space programs configurationenablethefollowingoptions:
Kernel/Library/Defaults Selection ---> [*] Customize Kernel Settings [*] Customize Application/Library Settings
Thenexitfromthisdialogandsaveyoursettingswhenasked. Inthefollowing,twoconfigurationdialogsareopenedconsecutively:Thefirstoneincludes allconfigurationoptionsfortheuClinuxkernel,e.g.Blackfinspecificsettings,devicedrivers andfilesystemsupport.Afteryouhavemadechangesaccordingtoyourwishes,exitfrom thatdialogandsavethesettings. Now, the last dialog is opened which includes options for tools and applications. They are dividedintocategories.IfyouwantaprogramtobeavailableunderuClinux,enableithere tobuildit.Again,exitandsaveyoursettings. 9.2.3 Compiling uClinux IntheuClinuxdistdirectory,simplytype
make
after the configuration to start the building process. Now, the kernel will be built first, followed by the selected applications. The first compilation from fresh source code needs sometimetocomplete,thereafteracompilationrunsmuchfaster. After a successful build, the uClinux and file system images are copied to the uClinuxdist/images/directory,seechapter9.1forshortashortexplanationofthegeneratedfiles. Pleaserefertosection8.8forinstructionshowtoboottheseimageswithUBoot.
BlackfinuClinuxUserGuide
Page27
Tinyboards maximumperformanceatminimumsize
9.2.4 Special considerations for CM-BF548 ThereisanissuewithBF548processorswithrevisionnumber<0.2withuClinuxduetoan anomaly of the processor. You will get an error explaining the details for those processor revisionsatcompiletime. Settingtherevisionoftheprocessorisdoneinthekernelconfigurationmenu:
Blackfin Processor Options ---> Silicon Rev (0.0) --->
Furthermore, enable additional file system support in the File Systems menu which you wanttouse. 9.3.2 USB support (CM-BF527, CM-BF548) ThedefaultsettinginthekernelconfigurationisforUSBHost:
Device Drivers ---> [*] USB support ---> <M> Support for Host-side USB [*] USB device filesystem [*] Disable external hubs <M> Inventra Highspeed Dual Role Controller (TI, ADI, ...) Driver Mode (USB Host) ---> (onlyforCMBF527) [*] Disable DMA (always use PIO) <M> USB Mass Storage support
BlackfinuClinuxUserGuide
Page28
<M>
Tinyboards maximumperformanceatminimumsize
USB Gadget Support ---> USB Peripheral Controller Inventra HDRC USB Peripheral (TI, ADI, ...) Ethernet Gadget (with CDC Ethernet support)
<M>
(NotethatSCSIdisksupportisrequiredforUSBMassStorageSupport.) USB Host Example: To attach a USB mass storage device, connect Jumper JP3 of your Eval/DevBF5xx>=V5.1boardtoprovideVBUSvoltage.BootuClinux,andloadthefollowing modules:
modprobe usbcore modprobe musb_hdrc modprobe usb-storage
ThenconnectthedevicetoUSB.ThekerneldetectsthenewUSBdeviceandcreatesanew device file in the /dev/ directory. To mount the first partition of the device with VFAT file system,type
mount t vfat /dev/sdb1 /mnt
USB Device example: To enable Ethernet over USB, remove jumper JP3. In the kernel configuration,setthedrivermodetodevicemode:
Device Drivers ---> [*] USB support ---> <M> Inventra Highspeed Dual Role Controller (TI, ADI, ...) Driver Mode ---> USB Peripheral (gadget stack) USB Gadget Support ---> USB Peripheral Controller ---> Inventra HDRC USB Peripheral (TI, ADI, ...)
CompileandbootuClinux.Thenloadthefollowingmodules:
modprobe musb_hdrc modprobe g_ether
BlackfinuClinuxUserGuide
Page29
Tinyboards maximumperformanceatminimumsize
5 4 3 2 1
BlackfinuClinuxUserGuide
Page30
Tinyboards maximumperformanceatminimumsize
BlackfinuClinuxUserGuide
Page31