日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當(dāng)前位置:首頁(yè) > 單片機(jī) > 單片機(jī)
[導(dǎo)讀]  趁熱打鐵,在上一PIC32MZ UDP ethernet bootloader的基礎(chǔ)上我又完成了采用TCP協(xié)議的PIC32MZ ethernet bootloader。兩款ethernet bootloader基本架構(gòu)都一樣,數(shù)據(jù)包格式也一樣。TCP ethernet bootloader 也分兩部

  趁熱打鐵,在上一PIC32MZ UDP ethernet bootloader的基礎(chǔ)上我又完成了采用TCP協(xié)議的PIC32MZ ethernet bootloader。兩款ethernet bootloader基本架構(gòu)都一樣,數(shù)據(jù)包格式也一樣。TCP ethernet bootloader 也分兩部分,我將他們命名為PhnLoader_v4.0和PhnBoot_v4.0。

PhnLoader_v4.0

  PhnLoader_v4.0 是PC端host 程序。

運(yùn)行環(huán)境:Window + .NET Framework 4.5

開(kāi)發(fā)語(yǔ)言:C#

通信類(lèi)型:TCP Server

IP 地址: 192.168.1.105

端口號(hào): 8720

  UI 如下:

  主要代碼如下:


try{while(loaderReader.Peek()>=0){pBarLoading.PerformStep();recordLine=loaderReader.ReadLine();if(recordLine.Contains(EXTEND_TOKEN)==true){if(recordLine.Contains(USER_ID_TOKEN)==true){isNextLineUserID=true;continue;}//elseif(recordLine.Contains(CONFIG_BITS_TOKEN)==true)//{//constintADDR_U_START_INDEX=9;//constintADDR_U_LENGTH=4;//stringaddrU=recordLine.Substring(ADDR_U_START_INDEX,ADDR_U_LENGTH);//loaderUpperAddr=Convert.ToInt32(addrU,16)<<16;//isNextLineConfigBits=true;//continue;//}elseif(recordLine.Contains(PIC32_CONFIG_BITS_TOKEN)==true){constintADDR_U_START_INDEX=9;constintADDR_U_LENGTH=4;stringaddrU=recordLine.Substring(ADDR_U_START_INDEX,ADDR_U_LENGTH);loaderUpperAddr=Convert.ToInt32(addrU,16)<<16;isNextLineConfigBits=true;continue;}else{constintADDR_U_START_INDEX=9;constintADDR_U_LENGTH=4;stringaddrU=recordLine.Substring(ADDR_U_START_INDEX,ADDR_U_LENGTH);loaderUpperAddr=Convert.ToInt32(addrU,16)<<16;continue;}}elseif(recordLine.Contains(END_OF_HEX_FILE_TOKEN)==true){break;}if(isNextLineUserID){isNextLineUserID=false;//donothing;}elseif(isNextLineConfigBits){if(!DownloadConfigLine(recordLine)){Debug.WriteLine("Errorfoundduringconfigurationbitsprogramming");loaderReader.Close();loaderServer.Close();btnDownload.Enabled=true;return;}isNextLineConfigBits=false;}else{if(!DownloadDataLine(recordLine)){Debug.WriteLine("Errorfoundduringdataprogramming");loaderReader.Close();loaderServer.Close();btnDownload.Enabled=true;return;}}}}catch(Exceptionex){Debug.WriteLine("Error:"+ex.Message);textBoxStatus.ForeColor=Color.Red;textBoxStatus.AppendText("Downloadingfailedrn");textBoxStatus.ForeColor=Color.Black;loaderServer.Close();loaderReader.Close();btnDownload.Enabled=true;return;}textBoxStatus.AppendText("Downloadingcompletedrn");

本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請(qǐng)聯(lián)系該專(zhuān)欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請(qǐng)及時(shí)聯(lián)系本站刪除。
換一批
延伸閱讀

總線-Ethernet與EtherCAT的比較

關(guān)鍵字: ethercat ethernet

Microchip公司的PIC32MZ EF系列是高達(dá)250MHz的集成浮點(diǎn)單元(FPU),具有廣泛的外設(shè)和包括局域網(wǎng)(CAN)的極好的連接選擇,工作電壓2.1V到 3.6V,DSP增強(qiáng)核具有四

關(guān)鍵字: Microchip pic32mz 處理器

  隨著半導(dǎo)體技術(shù)的不斷進(jìn)步(按照摩爾定律),MCU內(nèi)部集成的邏輯功能外設(shè)越來(lái)越多,存儲(chǔ)器也越來(lái)越大。消費(fèi)者對(duì)于汽車(chē)節(jié)能(經(jīng)濟(jì)和法規(guī)對(duì)排放的要求)型、舒適性、互聯(lián)性、安全性(功能安全和信息安全)

關(guān)鍵字: bootloader 汽車(chē)電子

1.之所以要實(shí)現(xiàn)一個(gè)專(zhuān)用的bootloader,一是為了更好的移植和自身的升級(jí),二是為了方便操作系統(tǒng)的調(diào)試,當(dāng)然,你完全可以將這部分所要實(shí)現(xiàn)的與操作系統(tǒng)相關(guān)的功能集成到操作

關(guān)鍵字: bootloader 如何實(shí)現(xiàn) 嵌入式開(kāi)發(fā)

  An interrupt is an internal or external event that requires quick attention from the controller. The PIC32MZ...

關(guān)鍵字: interrupt pic32mz timer tutorial

一、Android網(wǎng)絡(luò)簡(jiǎn)介Android與服務(wù)器的通信方式主要有兩種,一種是Http通信,另一種是Socket通信。HTTP通信:Android中內(nèi)置HttpClient,這樣可以發(fā)方便的發(fā)送Http

關(guān)鍵字: Android tcp協(xié)議 網(wǎng)絡(luò)通信

  In my last post I implement "Key Debounce" with port polling, port polling is not very efficient....

關(guān)鍵字: pic32mz tutorial change notification
關(guān)閉