RTL8710BN BuildandDebugEnvironmentSetupIAR ThisdocumentillustrateshowtobuildRealteklowpowerWiFisoftwareunderIARSDK environment. RTL8710BN TableofContents 1. Introduction .................................................................................................................................3 2. HowtogetIAR .............................................................................................................................3 3. AmebaZHardwareConfiguration ...............................................................................................3 4. Howtobuildanddownloadcode................................................................................................4 4.1IARbuild .................................................................................................................................4 4.2IARdownload .........................................................................................................................8 4.3IARdebug .............................................................................................................................10 Imagetooldownload .................................................................................................................13 5. 6. Howtouseperipheralsamplecode ..........................................................................................14 7. Warning......................................................................................................................................15
. 20171226 2 1.Introduction RTL8710BN ThisdocumentillustrateshowtobuildRealteklowpowerWiFisoftwareunderIARSDK environment. 2.HowtogetIAR IARprovidesanIDEenvironmentforcodebuilding,downloading,anddebugging.Pleasecheck IAREmbeddedWorkbenchonhttp://www.iar.com/,andtrailversionisavailable. 3.AmebaZHardwareConfiguration HardwareblockdiagramisshowninFigure31Hardwareblockdiagram.TheblockUSBUARTis usedtosupplypowerandcatchlogs,UARTbaudis115200.SWDmeansJLinkSWDinterface, whenitisconnectedtoJLinkAdaptercorrectly,youcandownloadimagestoAmebaZfromIAR flashdownloader.ResetbuttonisusedtoresetAmebaZtorunfirmwareafterIARcompletes downloading. TheDupontLinediagrambetweenJLinkAdapterandAmebaZSWDisasfollows:
Figure31Hardwareblockdiagram 20171226 3 RTL8710BN 3.3VGND DATACLK SWD Figure32JLinkSWDconnection PleasenoticethatDAPchipisnotweldingontheAmebaZdemoboardandsoDAPfunctionisnot enabledwhichmeansMBEDudiskcopyisdisabled. Physicalconnectionasshownbelow:
Figure33Physicalconnection 4.Howtobuildanddownloadcode PleasemakesureUSBUARTisconnectedtoPCwithUSBlineandSWDisconnecttoJLinkAdapter withDupontLinebeforedownloadcode. 4.1IARbuild Step1:OpenIARWorkbench Step2:Toopenproject,clickFileOpenWorkspace 20171226 4 RTL8710BN Step3:SelectProject.ewwinproject\realtek_amebaz_va0_example\EWARMRELEASE ClickProjectOptions,GeneralOptions>Target>ProcessorVariant>Core,makesureyouhave chosenCortexM4f.IfyourIARnotsupportthiscore,PleasechooseCortexM4andFloatingpoint settings>FPUissettoVFPv4singleprecision. Step4:Tobuildproject,clickProjectRebuildAll 20171226 5 Thenyouwillgetboot_all.binandimage2_all_ota1.binin project\realtek_amebaz_va0_example\EWARMRELEASE\Debug\Exe. RTL8710BN Step5:Tobuildimage2_all_ota2.binforOTA,clickProject>Options>BuildActions>BuildActions Configuration>Prebuildcommandline,changethesecondaryparameter1to2shownas follows,thenClickOKandmakeprojectRebuildAll. Thenyouwillgetimage2_all_ota2.bininproject\realtek_amebaz_va0_example\EWARMRELEASE
\Debug\Exe. 20171226 6 RTL8710BN Bytheway,thembedAPIsincludeCfilesandHeaderfilesusedbyAmebaZislocatedin component\soc\realtek\8711b\mbed\.Itwillalsobemergedtocomponent\common\mbed\in nextversion.NowifyouuseAmeba1,pleasechoosefilesfromcomponent\common\mbed\andif youuseAmebaZ,pleasechoosefilesfromcomponent\soc\realtek\8711b\mbed\. 20171226 7 4.2IARdownload RTL8710BN TheAmebaZdemoboardonlysupportsJLINKSWDdownloadanddebug. PleasenotethatifyouwantuseIARdownloadimagetodebug,pleasesetthesecondary parameterofprebuild.batto1andbuild. Step1:PleasecheckJlinkdebuggerissettingcorrect.Click Project>Options>Debugger>Setup>Driver,andchooseJLink/JTrace.ThenclickDebugger>
JLink/JTrace>Connection>InterfaceandchooseSWD. 20171226 8 RTL8710BN Step2:Todownloadcode,clickProject>Download>Downloadactiveapplication. 20171226 9 RTL8710BN Afterfirmwaredownload,clickResetbuttontorebootthesystem. 4.3IARdebug Todebugortracecodestepbystep,clickProjectDownloadandDebugorpressoneofthetwo buttons intheIARmenu. Upperleftcornerofthetoolbarshowsstepbysteptrackingtools. 20171226 10 RTL8710BN HowtosetBreakpointisshownasfollows:
Bytheway,ROMcodeandBootloadercodeisprovidedbymeansofthesymbollisttables, rom_symbol_v01_iar.icfandbootloader_symbol.icf.Youcanfinditin project\realtek_amebaz_va0_example\EWARMRELEASE.Soifyouaretrackingtothefunction whichisrunningintheROMorbootloaderarea,thesourcecodecantbelocated. 20171226 11 RTL8710BN 20171226 12 RTL8710BN 5.Imagetooldownload PleasereferenceAN0112RealtekAmebaZImageToolusermanual.doc.pdffordetails. AssumingthattheImageToolonPCisServer,whichsendsimagesfilestoAmebaZ(Client)through UART.ClientorServer,whicheverstartsfirstwillbeok. StepsonAmebaZ Step1:ForQFN32,pinsmarkedwith1onthefigureshouldbeconnectedbyjumpercap. ForQFN48&QFN68,pinsmarkedwith2shouldbeconnectedbyjumpercap. Step2:PushtheImageDownloadButtonandkeepitpressed. Step3:PowerontheboardorpresstheResetButton.NowAmebaZgoesintoUARTDOWNLOAD mode. Step4:FinallyreleasetheImageDownloadButton.Nowtheclientisreadyforreceivingdata. Figure51AmebaZDEV Stepsonimagetool Step1:Selectserialport.Thedefaultbaudrateis1.5Mbps. Step2:Selecttransmissionbaudrate Step3:Openserialport Step4:Checktheimagestobetransferred Step5:SelectandloadimagesfilesbybrowsingwhicharegeneratedbyIARproject. Step6:Inputimageaddresses.Theaddresswhichstartswith0x08isforflash,and0x10forRAM. Step7:PushDownloadbuttontostart.Nowtheserverisreadytosenddata. 20171226 13 RTL8710BN Figure52ImageDownloadTabpage Whentheclientandserverarebothready,datatransmissionbegins. Theprogressbarwillshowthetransmitprogressofeachimage.Youcanalsogetthemessageof operationsuccessfulorerrorsoccurfromlogwindow. 6.Howtouseperipheralsamplecode Thereareseveralperipheralexamplecodeunderfolderproject\realtek_amebaz_va0_example
\example_sources\,youcancopy&pastetheexamplesincandsrctoprojectfolder. Ex.Tousei2cexamplecode,youcancopysrcandincfromproject\
realtek_amebaz_va0_example\example_sources\i2c\. 20171226 14 RTL8710BN AmebaAPIfollowsMBEDAPI.UsercancheckMBEDwebsiteforperipheralAPI. 7.Warning 7.1FederalCommunicationCommissionInterferenceStatement FederalCommunicationCommissionInterferenceStatement ThisequipmenthasbeentestedandfoundtocomplywiththelimitsforaClassBdigitaldevice, pursuanttoPart15oftheFCCRules.Theselimitsaredesignedtoprovidereasonableprotection againstharmfulinterferenceinaresidentialinstallation.Thisequipmentgenerates,usesandcan radiateradiofrequencyenergyand,ifnotinstalledandusedinaccordancewiththeinstructions, maycauseharmfulinterferencetoradiocommunications.However,thereisnoguaranteethat interferencewillnotoccurinaparticularinstallation.Ifthisequipmentdoescauseharmful interferencetoradioortelevisionreception,whichcanbedeterminedbyturningtheequipment offandon,theuserisencouragedtotrytocorrecttheinterferencebyoneofthefollowing measures:
Reorientorrelocatethereceivingantenna. Increasetheseparationbetweentheequipmentandreceiver. Connecttheequipmentintoanoutletonacircuitdifferentfromthattowhichthereceiveris connected. Consultthedealeroranexperiencedradio/TVtechnicianforhelp. ThisdevicecomplieswithPart15oftheFCCRules.Operationissubjecttothefollowingtwo conditions:(1)Thisdevicemaynotcauseharmfulinterference,and(2)thisdevicemustacceptany interferencereceived,includinginterferencethatmaycauseundesiredoperation. FCCCaution:Anychangesormodificationsnotexpresslyapprovedbythepartyresponsiblefor compliancecouldvoidtheuser'sauthoritytooperatethisequipment. 20171226 15 RTL8710BN IMPORTANTNOTE:
FCCRadiationExposureStatement:
ThisequipmentcomplieswithFCCradiationexposurelimitssetforthforanuncontrolled environment.Thisequipmentshouldbeinstalledandoperatedwithminimumdistance20cm betweentheradiator&yourbody. IEEE802.11bor802.11goperationofthisproductintheU.S.A.isfirmwarelimitedtochannels1 through13. ThismoduleisintendedforOEMintegrator.TheOEMintegratorisresponsibleforthecompliance toalltherulesthatapplytotheproductintowhichthiscertifiedRFmoduleisintegrated. Additionaltestingandcertificationmaybenecessarywhenmultiplemodulesareused. 20cmminimumdistancehastobeabletobemaintainedbetweentheantennaandtheusersfor thehostthismoduleisintegratedinto.Undersuchconfiguration,theFCCradiationexposurelimits setforthforanpopulation/uncontrolledenvironmentcanbesatisfied. USERSMANUALOFTHEENDPRODUCT:
Intheusersmanualoftheendproduct,theenduserhastobeinformedtokeepatleast20cm separationwiththeantennawhilethisendproductisinstalledandoperated.Theenduserhasto beinformedthattheFCCradiofrequencyexposureguidelinesforanuncontrolledenvironment canbesatisfied.Theenduserhastoalsobeinformedthatanychangesormodificationsnot expresslyapprovedbythemanufacturercouldvoidtheuser'sauthoritytooperatethisequipment. Ifthesizeoftheendproductissmallerthan8x10cm,thenadditionalFCCpart15.19statementis requiredtobeavailableintheusersmanual:ThisdevicecomplieswithPart15ofFCCrules. Operationissubjecttothefollowingtwoconditions:(1)thisdevicemaynotcauseharmful interferenceand(2)thisdevicemustacceptanyinterferencereceived,includinginterferencethat maycauseundesiredoperation. LABELOFTHEENDPRODUCT:
Thefinalendproductmustbelabeledinavisibleareawiththefollowing"ContainsTXFCCID:
TX2RTL8710BN".If the labelling area is larger than the palm of the hand, then the following FCC part 15.19 statement has to also be available on the label: This device complies with Part 15 of FCC rules. Operation is subject to the following two conditions: (1) this device may not cause harmful interference and (2) this device must accept any interference received, including interference that may cause undesired operation. Antennalist:
Ant. Brand ModelName(P/N) 1 2 3 Note:TheEUThasthreetypeantennas. REALTEK AmebaAM0001 JOYMAX TWF614XMPXX500 LYNwave ALA110222050300010 PIFAAntenna AntennaType PrintedAntenna N/A DipoleAntenna IPEX IPEX Connector Gain(dBi) 2.9 3.0 3.5 20171226 16 7.2NCC RTL8710BN
, CC XX xx LP yyy Zz 20171226 17