• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users






Re: SAME54 Bootloader範例請教
#3
資深會員
資深會員


查看用戶資訊
感謝提示,

我搜尋時也看到這篇,有提到可以使用MPLAB IPE來產生(如附檔)
我試了一下,除了.bin檔外,也產生了一個.pm3檔案,不知功能為何

所以在compiler選項中新增
${MP_CC_DIR}/xc32-objcopy -I ihex -O binary ${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.hex ${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.bin

就每次compile完會自動新增bin檔的樣子,應該是比較方便些

我想知道bin檔裡的內容是怎麼定義的,如hex檔中有:
:1010000014EF09F0FF00FF005982FACF03F0FBCF85


表示起始位址0x1000,資料長度16位,類型為data

.bin檔的內容是怎麼mapping到program memory的?是否有相關的說明?
(.bin檔是否只是把hex中每一行的data段轉為binary後連在一起?)

因我從範例程式看起來,bin檔讀出後完全沒有處理就直接用NVMCTRL_PageWrite寫入了,addr都必須自己計算(bootloader必須寫死app起始位址而非從hex檔中讀出每行的位址)

請教一下基礎概念:
.SAME54每個指令的長度(1 instruction = ? Bytes)
.Program memory及hex檔在顯示時,每一行為16 Bytes (Hex的Data部份),hex檔中的每一行是幾個instruction?
.PC在前進時,每次應該是前進1個instruction?(若沒有jump的話)

有沒有專門解釋相關概念的說明?

其實我目前只是想知道,bootloader中每次燒錄512Bytes,是否裡面固定包含512 / 16 = 32行Hex?




case BOOTLOADER_READ_FILE:
        {
            
fileReadLength SYS_FS_FileRead(btlData.fileHandle, (void *)fileBufferPAGE_SIZE);

            
/* Reached End of File */
            
if (fileReadLength <= 0)
            {
                
SYS_FS_FileClose(btlData.fileHandle);

                
bootloader_TriggerReset();
            }
            else
            {
                
btlData.currentState BOOTLOADER_PROCESS_FILE_BUFFER;
            }

            break;
        }

        case 
BOOTLOADER_PROCESS_FILE_BUFFER:
        {
            
bootloader_NVMPageWrite(fileBuffer);

            
memset((void *)fileBuffer0xFFPAGE_SIZE);

            
btlData.currentState BOOTLOADER_READ_FILE;

            break;
        }




void bootloader_NVMPageWrite(uint8_tdata)
{
    
NVMCTRL_PageWrite((uint32_t *)databtlData.progAddr);

    while(
NVMCTRL_IsBusy() == true);

    
btlData.progAddr += PAGE_SIZE;
}

Attach file:



jpg  MPLAB_IPE.jpg (167.82 KB)
4537_6090bca6e2941.jpg 1920X1048 px

發表於: 2021/5/4 12:13
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: SAME54 Bootloader範例請教
#2
管理員
管理員


查看用戶資訊

發表於: 2021/5/3 18:15
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


SAME54 Bootloader範例請教
#1
資深會員
資深會員


查看用戶資訊
最近看到Harmony v3的更新中加了些範例,其中Bootloadrer新增了ethernet、I2C、SD Card

Bootloader Library Help的Introduction中可看到更新檔有Binary File與Normalized Hex File兩種

關於Binary File的部份,我參考SD Card範例,看到流程大致上是從檔案中每次讀取512Bytes(1個Page),然後呼叫NVMCTRL_PageWrite來寫入整個Page

請問有Binary File的相關說明嗎?包含:(因MPLAB X compile出來預設只有hex檔)
.如何產生Binary File?
.是否有bin檔(Binary File)格式的說明?

發表於: 2021/5/3 14:08
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------