• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users




(1) 2 »


Re: ATSAMHA1E16AB 這顆IC如何設定程式保護?
#13
資深會員
資深會員


查看用戶資訊
將燒錄器的範圍改成手動就可以讀取程式碼了,預設是無法讀取??
縮圖

縮圖

Attach file:



jpg  Image 1019006.jpg (286.35 KB)
546_634ff4808f20d.jpg 523X447 px

jpg  Image 1019005.jpg (112.30 KB)
546_634ff4e02cf08.jpg 901X588 px

發表於: 2022/10/19 20:59
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAMHA1E16AB 這顆IC如何設定程式保護?
#12
資深會員
資深會員


查看用戶資訊
順便問一下為什麼IPE 讀取 ATSAM的IC一定要掛入HEX才能讀取,掛入HEX檔再移除HEX檔也還是可以讀取,讀IPE剛打開選完IC和燒錄器沒掛HEX檔就是無法讀取程式

PIC IC沒有這個問題

縮圖

Attach file:



jpg  Image 1019005.jpg (640.29 KB)
546_634fb6e09b0be.jpg 1682X953 px

發表於: 2022/10/19 16:36
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAMHA1E16AB 這顆IC如何設定程式保護?
#11
資深會員
資深會員


查看用戶資訊
不知道什麼原因我的X IDE 5.50都沒辨法讀取程式 在Execution Memory都看不到什麼變化,一直都是0xFFFF

改用IPE 5.50就可以讀取程式了
縮圖

Attach file:



jpg  Image 1019003.jpg (684.91 KB)
546_634fb2ef818c1.jpg 1919X996 px

發表於: 2022/10/19 16:20
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAMHA1E16AB 這顆IC如何設定程式保護?
#10
管理員
管理員


查看用戶資訊
相同料號的IC當然SecurityBit的地址是一樣的,
另外這行指令在執行 Debug 時, 並不會編譯及設置 Security Bit.
#ifndef __DEBUG
const unsigned int __attribute__((space(prog), keep, address(0x41004000))) SET_SECURITY_BIT = 1;
#endif

MPLAB X IDE 的某一個版本有一個盲點, (我目前使用最新的版本已經修正)
會誤以為可以在Security Bit設置後還可以讀回內容,
當正常燒錄設有Security Bit的程式到Chip之後, 接著立即執行讀回Flash的內容,
此時, Execution Memory中會有看似讀回的內容, 但其實是之前燒錄的HEX內容,
另外, 執行Erase Chip (Erase All) 也會清除 Security Bit.
新專案預設會先執行 Erase All 再燒錄 Hex.
縮圖


因此, 請使用以下步驟驗證Security Bit是否有作用
1. 執行正常燒錄 Hex 到Chip, (不要使用Debug燒錄)
2. 關閉 X IDE
3. 開啟 X IDE,
4. 前去 Execution Memory 視窗查看內容是否為都為 0xFFFFFFFF
5. 直接執行讀取 Flash 的步驟 (不要燒錄後再讀取)
6. 前去 Execution Memory 視窗查看內容
7. 此時的 Execution Memory 會出現, 不是程式但也不是 0xFFFFFFFF 整齊的內容
這是我用SAMD21設好Security Bit後讀回的內容.
縮圖

Attach file:



jpg  SecurityBitFlashRead.jpg (195.89 KB)
67979_634ca76acbacc.jpg 527X292 px

jpg  EraseAll.jpg (119.16 KB)
67979_634ca82519588.jpg 703X408 px

發表於: 2022/10/17 8:53
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAMHA1E16AB 這顆IC如何設定程式保護?
#9
資深會員
資深會員


查看用戶資訊
相同的IC 建立新專案 位址應該是一樣的吧?!
一定要用那個專案來開hammony建立才行嗎?

將這段程式碼貼到相同IC的專案之中, initialization.c 下

斷電重開...還是可以將程式讀出來....


#ifndef __DEBUG
const unsigned int __attribute__((space(prog), keep, address(0x41004000))) SET_SECURITY_BIT = 1;
#endif

發表於: 2022/10/14 12:31
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAMHA1E16AB 這顆IC如何設定程式保護?
#8
管理員
管理員


查看用戶資訊
必須要用Harmony Gen出來的Security Bit設定才能使用, 不可使用別顆的程式貼上, 因為Security Bit地址可能不同.
在燒錄時, MPLAB XIDE 專案中的燒錄器設定, 預設會清除Flash才進行燒錄, 此時會自動解除 Security Bit
但是在燒錄後即會重新設定 Security Bit,
當你剛燒完立刻選擇讀取Flash時, MPLAB X IDE中的Program Memory會是上次燒錄時的內容, 可以關掉MPLAB X IDE重新進入來確定是否是新讀出來的內容,

發表於: 2022/10/7 17:42
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAMHA1E16AB 這顆IC如何設定程式保護?
#7
資深會員
資深會員


查看用戶資訊
設定如下圖 是不是有什麼設定錯誤的呢??

Attach file:



jpg  Image 0927017.jpg (345.08 KB)
546_6332f3aaf10c4.jpg 1920X926 px

發表於: 2022/9/27 20:59
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAMHA1E16AB 這顆IC如何設定程式保護?
#6
資深會員
資深會員


查看用戶資訊
我試著建立一個新的專案(空的) 設定保護Bit
燒錄後程式還是可以讀回來

Attach file:



jpg  Image 0927016.jpg (628.48 KB)
546_6332f3332b45c.jpg 1912X1008 px

發表於: 2022/9/27 20:57
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAMHA1E16AB 這顆IC如何設定程式保護?
#5
資深會員
資深會員


查看用戶資訊
我找到一段說明 他的設定方式又不太一樣 他的說明我看了不是很理解
https://microchipsupport.force.com/s/a ... /SAM-D-L-C---Security-bit

Question
How to set and check the security bit in software (without power on reset) ?



or



The SSB command is used to set the Security bit. However, the Security Bit does not seem to be set until a power cycle is done. Is there a way to get the Security bit to be effective immediately without power on reset?

Answer
The security bit is read by the hardware only after a reset. For setting the security bit through software, first set the fuse bit using SSB command, then do a software reset using NVIC_SystemReset() API, which resets the MCU.



The below code will set security bit and give software reset. After the device resets, it turns on the PB30 pin.

發表於: 2022/9/27 14:34
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAMHA1E16AB 這顆IC如何設定程式保護?
#4
資深會員
資深會員


查看用戶資訊
參照:

yiming wrote:
我有將那段程碼放到initialization.c 中,再重新編凙後用IPE燒錄以PICKIT4,發現燒錄玩後程式還是能夠讀取回來....

是不是還有其它地方也需要修改???


因為我目前的專案無法開啟Harmony ,所以我新開了一個專案進入Harmony 把那段程式碼放到了我的專案下再進行編輯...但程式還是可以讀回來...是那裡少做了嗎???

#ifndef __DEBUG
const unsigned int __attribute__((space(prog), keep, address(0x41004000))) SET_SECURITY_BIT = 1;
#endif

發表於: 2022/9/27 11:00
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... ]

教育訓練中心

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