본문으로 바로가기

[secure_bootloader ] 프로젝트 분석

category Nordic_nRF52 2022. 4. 11. 11:15

 : BLE Secure DFU bootloader 예제로 booloader 와 DFU 모듈을 사용합니다.

 

1> 프로젝트 위치

  : <InstallFolder>\examples\dfu\secure_bootloader\pca10040_s132_ble

 

2> Nordic Document

https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_dfu_bootloader.html

 

nRF5 SDK v17.0.2: BLE Secure DFU Bootloader

This example requires one of the following SoftDevices: S112, S113, S132, S140 Important: Before you run this example, make sure to program the SoftDevice. The BLE Secure DFU Bootloader example uses the Bootloader and DFU modules to implement a bootloader

infocenter.nordicsemi.com

 

 3> 테스트 방법

  :  build 설정은 되어있다는 가정하에 시작합니다.

  3-1> 이미지 빌드 (SES 상에서 빌드)

 

 3-2> SES 상에서 F5 (Go)를 누르면 Write && Run 이 됩니다. 

   >> SES Output 첨부합니다. 

Preparing target for download
Executing Reset script TargetInterface.resetAndStop()
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Downloading ‘s132_nrf52_7.2.0_softdevice.hex’ to J-Link
Programming 2.7 KB of addresses 00000000 — 00000aff
Programming 146.3 KB of addresses 00001000 — 0002596b
J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (4096 bytes)
J-Link: Flash download: Total: 0.632s (Prepare: 0.191s, Compare: 0.169s, Erase: 0.006s, Program & Verify: 0.126s, Restore: 0.138s)
J-Link: Flash download: Program & Verify speed: 31 KB/s
Download successful
Downloading ‘secure_bootloader_ble_s132_pca10040.elf’ to J-Link
Programming 21.7 KB of addresses 00078000 — 0007d70f
Programming 0.0 KB of addresses 0007d710 — 0007d723
Programming 1.1 KB of .rodata addresses 0007d724 — 0007dbef
Programming 0.0 KB of addresses 0007dbf0 — 0007dc27
Programming 0.0 KB of addresses 10001014 — 1000101b
J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (4096 bytes)
J-Link: Flash download: Total: 0.273s (Prepare: 0.101s, Compare: 0.066s, Erase: 0.009s, Program & Verify: 0.036s, Restore: 0.058s)
J-Link: Flash download: Program & Verify speed: 110 KB/s
Download successful

 

  3-3> 앱 이미지 만들기 && 다운로드

   : 만들어진 앱의 Hex 파일에 사인을 한후 dfu package를 생성합니다.

     app_name.hex  및 private.key 를 가지고 있으면 nrfutil 을 사용해  zip  파일을 만들수 있습니다.

    app_name.hex   : 앱 빌드후 생성되는 hex 파일

    private.key        :  secure bootloader 이미지 빌드시 사용한  dfu_public_key.c 파일의 짝이되는 private.key

 

  >> nrfutil 명령어 예제

    nrfutil pkg generate --hw-version 52 --application-version 2 ^
       --application app_name.hex ^
       --sd-req 0x101 --key-file private.key app_dfu_package.zip

 

 

 3-4> app_dfu_package.zip 다운로드

  ▶  디바이스 dfu 모드 진입시키기

     :dfu 모드 버튼을 누르고 리셋

 

  ▶ 스마트폰 DFU 프로그램 실행

 

  ▶ 파일 선택하기

 

  ▶ DfuTarg 디바이스 스캔하기

 

 

 

 

  ▶ 업그레이드 시작및 상태 체킹하기

 

 

  ▶ "Completed " 메시지 확인하기

 

 

  ▶ 펌웨어 정상동작 확인 

     : 다운로드한 앱이 실행이 되는지 DFU 모드 재진입 등등 알아서 체킹

 

 3-5>  통합 이미지 만들기

   : 통합이미지를 만들어 nRF Programmer를 사용해 한번에 전부 Write 해 보겠습니다.

 

  ▶ softdevice + bootloader merge

mergehex -m ..\nRF5SDK_1702\nRF5_SDK\components\softdevice\s132\hex\s132_nrf52_7.2.0_softdevice.hex ^
         ..\nRF5SDK_1702\nRF5_SDK\examples\dfu\secure_bootloader\pca10040_s132_ble\ses\Output\Release\Exe\secure_bootloader_ble_s132_pca10040.hex ^
         -o sd_bl.hex

  ▶ softdevice + bootloader + application merge 

mergehex -m sd_bl.hex ^
            ..\nRF5SDK_1702\nRF5_SDK\examples\ble_peripheral\ble_app_xxx\pca10040\s132\ses\Output\Release\Exe\xxx_pca10040_s132.hex ^
            -o sd_bl_app.hex

 

  ▶ settings 만들기

 

nrfutil settings generate --family NRF52 ^
        --application ..\nRF5SDK_1702\nRF5_SDK\examples\ble_peripheral\ble_app_xxx\pca10040\s132\ses\Output\Release\Exe\xxx_pca10040_s132.hex ^
        --application-version 2 ^
        --bootloader-version 2 ^
        --bl-settings-version 1 settings.hex

  ▶ softdevice + bootloader + application +settings merge

mergehex -m sd_bl_app.hex settings.hex -o sd_bl_app_settings.hex

 

    ▶ 아래처럼 파일이 생성이 되면 OK

      : sd_bl_app_settings.hex 만 nRF Programmer 로 Write 하면 됩니다.

 

 

4> MBR 분석

D:\Project\SES\nrfutil>nrfjprog -f nrf52 --memrd 0x0 --n 0x1000
0x00000000: 20000400 00000A81 00000715 00000A61   |... ........a...|
0x00000010: 0000071F 00000729 00000733 00000000   |....)...3.......|
0x00000020: 00000000 00000000 00000000 00000AA5   |................|
0x00000030: 0000073D 00000000 00000747 00000751   |=.......G...Q...|
0x00000040: 0000075B 00000765 0000076F 00000779   |[...e...o...y...|
0x00000050: 00000783 0000078D 00000797 000007A1   |................|
0x00000060: 000007AB 000007B5 000007BF 000007C9   |................|
0x00000070: 000007D3 000007DD 000007E7 000007F1   |................|
0x00000080: 000007FB 00000805 0000080F 00000819   |................|
0x00000090: 00000823 0000082D 00000837 00000841   |#...-...7...A...|
0x000000A0: 0000084B 00000855 0000085F 00000869   |K...U..._...i...|
0x000000B0: 00000873 0000087D 00000887 00000891   |s...}...........|
0x000000C0: 0000089B 000008A5 000008AF 000008B9   |................|
0x000000D0: 000008C3 000008CD 000008D7 000008E1   |................|
0x000000E0: 000008EB 000008F5 000008FF 00000909   |................|
0x000000F0: 00000913 0000091D 00000927 00000931   |........'...1...|
0x00000100: 0000093B F000B51F E88DF803 BD1F000F   |;...............|
0x00000110: BCACF000 71FCF640 F04F6808 1C402210   |....@..q.hO.."@.|
0x00000120: 6808D008 D0091C40 1C406808 6808D004   |...h@....h@....h|
0x00000130: BA37F000 E7F56990 E7F96990 B5704770   |..7..i...i..pGp.|
0x00000140: 0B01460B F6004418 0B0470FF 5080F04F   |.F...D...p..O..P|
0x00000150: 03092200 03246903 43436940 46101B1D   |."...i$.@iCC...F|
0x00000160: FA48F000 46204629 4070E8BD BA42F000   |..H.)F F..p@..B.|
0x00000170: F64FB5F0 F44F73FF 461A75B4 E0111E6E   |..O..sO..u.Fn...|
0x00000180: D30142A9 E0004634 1B09460C 7B02F830   |.B..4F...F..0..{|
0x00000190: 443B1E64 D1F9441A EB04B29C B2944313   |d.;D.D.......C..|
0x000001A0: 4212EB04 D1EB2900 EB00B298 EB024013   |...B.).......@..|
0x000001B0: EA404112 BDF04001 B09249F3 E9D14604   |.A@..@...I...F..|
0x000001C0: E9CD0100 22FF0110 46682140 FBF4F000   |......."@!hF....|
0x000001D0: 000FE894 000FE88D A9104668 C804E002   |........hF......|
0x000001E0: 2D04F841 D1FA4288 46682110 FFC0F7FF   |A..-.B...!hF....|
0x000001F0: 20AA9010 0044F88D F999F000 FF8AF7FF   |... ..D.........|
0x00000200: 74FCF640 F04F6820 1C402510 6820D00F   |@..t hO..%@... h|
0x00000210: 46692210 F0003080 6820F978 D0081C40   |."iF.0..x. h@...|
0x00000220: 22086820 F000A910 F000F970 69A8F961   | h."....p...a..i|
0x00000230: 69A8E7EE F04FE7F5 69035080 F6406940   |...i..O..P.i@i@.|
0x00000240: 434371FC F04F6808 1C402210 6808D006   |.qCC.hO.."@....h|
0x00000250: 5080F500 D2034283 47702009 E7F76990   |...P.B... pG.i..|
0x00000260: 1C406808 6808D004 D0031C40 47702000   |.h@....h@.... pG|
0x00000270: E7F96990 47702004 4604B570 4DC36800   |.i... pGp..F.h.M|
0x00000280: D2762807 F000E8DF 29190433 00251E63   |.(v.....3..)c.%.|
0x00000290: 6502E9D4 46296864 F0004630 462AF962   |...edh)F0F..b.*F|
0x000002A0: 46304621 F931F000 462100AA F0004630   |!F0F..1...!F0F..|
0x000002B0: 2800FB57 2003D000 F000BD70 F44FFC09   |W..(... p.....O.|
0x000002C0: E0075080 F0001D20 2800F940 F000D1F4   |.P.. ...@..(....|
0x000002D0: 6860FBFF 20006028 1D24BD70 0007E894   |..`h(`. p.$.....|
0x000002E0: F0000092 2800FB3D 200ED0F6 F7FFBD70   |....=..(... p...|
0x000002F0: 2800FFA2 E9D4D1FA F04F0301 EB005180   |...(......O..Q..|
0x00000300: 69080283 4368694D D80E4282 70F8F640   |...iMihC.B..@..p|
0x00000310: F04F6805 1C6D2210 6805D009 0583EB05   |.hO.."m....h....|
0x00000320: 6949690B 429D434B 2009D903 6955BD70   |.iIiKC.B... p.Ui|
0x00000330: 6801E7F4 D0031C49 1C406800 E003D002   |...hI....h@.....|
0x00000340: E7FA6950 BD70200F F7FF4620 F7FFFF35   |Pi... p. F..5...|
0x00000350: 2800FF72 1D20D1F7 F8F7F000 D1F22800   |r..(.. ......(..|
0x00000360: 28006860 F000D1F0 F7FFF8E2 F000FED3   |`h.(............|
0x00000370: 2007F8BF B510BD70 2818460C 2001D002   |... p....F.(... |
0x00000380: BD106008 F7FF6820 6020FF77 6841BD10   |.`.. h..w. `..Ah|
0x00000390: B1094605 E0002701 F6402700 682074F8   |.F...'...'@..t h|
0x000003A0: 2610F04F D02B1C40 68AA6820 F0000092   |O..&@.+. h.h....|
0x000003B0: B338FAD7 008168A8 1C406820 6820D027   |..8..h.. h@.'. h|
0x000003C0: FEBDF7FF 6820B1D7 D0221C40 F04F6826   |...... h@.".&hO.|
0x000003D0: 68AC5080 6901686D 43516942 D90D42A9   |.P.hmh.iBiQC.B..|
0x000003E0: 69406901 42A14341 4621D908 F0004630   |.i@iAC.B..!F0F..|
0x000003F0: 4622F8B8 46304629 F887F000 F878F000   |.."F)F0F......x.|
0x00000400: E7D26970 F893F000 FE84F7FF 6970E7F6   |pi............pi|
0x00000410: 6976E7D6 F640E7DB 682074FC 2610F04F   |..vi..@..t hO..&|
0x00000420: D0231C40 1C406820 6820D00C D01F1C40   |@.#. h@... h@...|
0x00000430: 68206825 0580F105 D01B1C40 79386827   |%h h....@...'h8y|
0x00000440: D01928AA 70F8F640 1C496801 6801D042   |.(..@..p.hI.B..h|
0x00000450: D0451C49 1C496801 6801D03E 1C496809   |I.E..hI.>..h.hI.|
0x00000460: 6801D03E D0391C49 E03E6800 E7DA69B0   |>..hI.9..h>..i..|
0x00000470: E7DE69B5 E7E269B7 46282110 FE78F7FF   |.i...i...!(F..x.|
0x00000480: 42816839 6820D122 D0051C40 1000F8D4   |9h.B". h@.......|
0x00000490: 0280F101 E00731C0 E7F969B1 CA08B130   |.....1...i..0...|
0x000004A0: 0D04F851 D1014298 E0002001 428A2000   |Q....B... ... .B|
0x000004B0: B158D1F4 B1106828 D0032804 4628E7FE   |..X.(h...(....(F|
0x000004C0: FF65F7FF 68684931 E00E6008 FE22F7FF   |..e.1Ihh.`....".|
0x000004D0: F80EF000 E7BB6971 E7BF6971 E0046970   |....qi..qi..pi..|
0x000004E0: 5080F44F 1C496801 F000D001 E7FEFACB   |O..P.hI.........|
0x000004F0: 8F4FF3BF 68014826 F4014A26 431161E0   |..O.&H.h&J...a.C|
0x00000500: F3BF6001 BF008F4F E92DE7FD 461741F0   |.`..O.....-..A.F|
0x00000510: 4606460D E0062400 68294630 F854F000   |.F.F.$..0F)h..T.|
0x00000520: 1D2D1C64 42BC1D36 E8BDD3F6 F64081F0   |d.-.6..B......@.|
0x00000530: 680170FC D0041C49 0000F8D0 5180F44F   |.p.hI.......O..Q|
0x00000540: F04FE5FD 69802010 F04FE7F8 690A5180   |..O.. .i..O..Q.i|
0x00000550: 68006949 4282434A 2010D801 20004770   |Ii.hJC.B... pG. |
0x00000560: B5704770 4605460C 6680F44F 4628E008   |pGp..F.FO..f..(F|
0x00000570: F817F000 D30542B4 6480F5A4 5580F505   |.....B.....d...U|
0x00000580: D1F42C00 0000BD70 00000AF4 20000000   |.,..p.......... |
0x00000590: E000ED0C 05FA0004 68014814 D0FC2900   |.........H.h.)..|
0x000005A0: 4A134770 60112102 680B4910 D0FC2B00   |pG.J.!.`.I.h.+..|
0x000005B0: 1D1B4B0F 68086018 D0FC2800 60102000   |.K...`.h.(... .`|
0x000005C0: 28006808 4770D0FC B5104B09 601A2201   |.h.(..pG.K...".`|
0x000005D0: 68144A06 D0FC2C00 68106001 D0FC2800   |.J.h.,...`.h.(..|
0x000005E0: 60182000 28006810 BD10D0FC 4001E400   |. .`.h.(.......@|
0x000005F0: 4001E504 460CB570 F0004605 B910F873   |...@p..F.F..s...|
0x00000600: F87EF000 4621B128 E8BD4628 F0004070   |..~.(.!F(F..p@..|
0x00000610: 4621B807 E8BD4628 F0004070 0000B837   |..!F(F..p@..7...|
0x00000620: 2200B57F 92019200 92039202 0B000B0A   |..."............|
0x00000630: 23014669 E00A4402 F0000944 F851061F   |iF.#.D..D.....Q.|
0x00000640: FA035024 4335F606 5024F841 42821C40   |$P....5CA.$P@..B|
0x00000650: 490DD8F2 9A006808 60084310 68011D08   |...I.h...C.`...h|
0x00000660: 43119A01 F0006001 2800F83D 4906D00A   |...C.`..=..(...I|
0x00000670: 68083110 43109A02 1D096008 9A036808   |.1.h...C.`...h..|
0x00000680: 60084310 0000BD7F 40000600 4C0FB530   |.C.`.......@0..L|
0x00000690: BF002200 1302EB04 5800F8D3 F8D3B92D   |.".........X-...|
0x000006A0: B9155804 5808F8D3 1C52B11D D3F12A08   |.X.....X..R..*..|
0x000006B0: 2A08BD30 EB04D2FC F8C21202 F8C30800   |0..*............|
0x000006C0: 20021804 0808F8C3 0000BD30 4001E000   |... ....0......@|
0x000006D0: 5080F04F 0130F8D0 D0012808 47702000   |O..P..0..(... pG|
0x000006E0: 47702001 5080F04F 1130F8D0 D0052906   |. pGO..P..0..)..|
0x000006F0: 0130F8D0 D0011C40 47702000 47702001   |..0.@.... pG. pG|
0x00000700: 5080F04F 0130F8D0 D001280A 47702000   |O..P..0..(... pG|
0x00000710: 47702001 498F2008 58096809 20104708   |. pG. .I.h.X.G. |
0x00000720: 6809498C 47085809 498A2014 58096809   |.I.h.X.G. .I.h.X|
0x00000730: 20184708 68094987 47085809 49852030   |.G. .I.h.X.G0 .I|
0x00000740: 58096809 20384708 68094982 47085809   |.h.X.G8 .I.h.X.G|
0x00000750: 4980203C 58096809 20404708 6809497D   |< .I.h.X.G@ }I.h|
0x00000760: 47085809 497B2044 58096809 20484708   |.X.GD {I.h.X.GH |
0x00000770: 68094978 47085809 4976204C 58096809   |xI.h.X.GL vI.h.X|
0x00000780: 20504708 68094973 47085809 49712054   |.GP sI.h.X.GT qI|
0x00000790: 58096809 20584708 6809496E 47085809   |.h.X.GX nI.h.X.G|
0x000007A0: 496C205C 58096809 20604708 68094969   |\ lI.h.X.G` iI.h|
0x000007B0: 47085809 49672064 58096809 20684708   |.X.Gd gI.h.X.Gh |
0x000007C0: 68094964 47085809 4962206C 58096809   |dI.h.X.Gl bI.h.X|
0x000007D0: 20704708 6809495F 47085809 495D2074   |.Gp _I.h.X.Gt ]I|
0x000007E0: 58096809 20784708 6809495A 47085809   |.h.X.Gx ZI.h.X.G|
0x000007F0: 4958207C 58096809 20804708 68094955   || XI.h.X.G. UI.h|
0x00000800: 47085809 49532084 58096809 20884708   |.X.G. SI.h.X.G. |
0x00000810: 68094950 47085809 494E208C 58096809   |PI.h.X.G. NI.h.X|
0x00000820: 20904708 6809494B 47085809 49492094   |.G. KI.h.X.G. II|
0x00000830: 58096809 20984708 68094946 47085809   |.h.X.G. FI.h.X.G|
0x00000840: 4944209C 58096809 20A04708 68094941   |. DI.h.X.G. AI.h|
0x00000850: 47085809 493F20A4 58096809 20A84708   |.X.G. ?I.h.X.G. |
0x00000860: 6809493C 47085809 493A20AC 58096809   |<I.h.X.G. :I.h.X|
0x00000870: 20B04708 68094937 47085809 493520B4   |.G. 7I.h.X.G. 5I|
0x00000880: 58096809 20B84708 68094932 47085809   |.h.X.G. 2I.h.X.G|
0x00000890: 493020BC 58096809 20C04708 6809492D   |. 0I.h.X.G. -I.h|
0x000008A0: 47085809 492B20C4 58096809 20C84708   |.X.G. +I.h.X.G. |
0x000008B0: 68094928 47085809 492620CC 58096809   |(I.h.X.G. &I.h.X|
0x000008C0: 20D04708 68094923 47085809 492120D4   |.G. #I.h.X.G. !I|
0x000008D0: 58096809 20D84708 6809491E 47085809   |.h.X.G. .I.h.X.G|
0x000008E0: 491C20DC 58096809 20E04708 68094919   |. .I.h.X.G. .I.h|
0x000008F0: 47085809 491720E4 58096809 20E84708   |.X.G. .I.h.X.G. |
0x00000900: 68094914 47085809 491220EC 58096809   |.I.h.X.G. .I.h.X|
0x00000910: 20F04708 6809490F 47085809 490D20F4   |.G. .I.h.X.G. .I|
0x00000920: 58096809 20F84708 6809490A 47085809   |.h.X.G. .I.h.X.G|
0x00000930: 490820FC 58096809 F45F4708 49057080   |. .I.h.X.G_..p.I|
0x00000940: 58096809 00004708 49044803 4B034A02   |.h.X.G...H.I.J.K|
0x00000950: 00004770 20000000 00000B00 00000B00   |pG..... ........|
0x00000960: 0301EA40 079BB510 2A04D10F C810D30D   |@..........*....|
0x00000970: 1F12C908 D0F8429C BA19BA20 D9014288   |.....B.. ....B..|
0x00000980: BD102001 30FFF04F B11ABD10 D00307D3   |. ..O..0........|
0x00000990: E0071C52 BD102000 3B01F810 4B01F811   |R.... .....;...K|
0x000009A0: D1071B1B 3B01F810 4B01F811 D1011B1B   |.......;...K....|
0x000009B0: D1F11E92 BD104618 03FFF002 2203EA43   |.....F......C.."|
0x000009C0: 4202EA42 B805F000 47704770 F04F4770   |B..B....pGpGpGO.|
0x000009D0: 29040200 8012F0C0 0C03F010 801BF000   |...)............|
0x000009E0: 0C04F1CC 0F02F1BC F800BF18 BFA82B01   |.............+..|
0x000009F0: 2B02F820 010CEBA1 B80DF000 7CC1EA5F   | ..+........_..||
0x00000A00: F800BF24 F8002B01 BF482B01 2B01F800   |$....+...+H....+|
0x00000A10: F04F4770 B5000200 46944613 39204696   |pGO......F.F.F 9|
0x00000A20: E8A0BF22 E8A0500C F1B1500C F4BF0120   |"....P...P.. ...|
0x00000A30: 0709AFF7 E8A0BF28 BF48500C F85DC00C   |....(....PH...].|
0x00000A40: 0089EB04 F840BF28 BF082B04 BF484770   |....(.@..+..pGH.|
0x00000A50: 2B02F820 4F80F011 F800BF18 47702B01   | ..+...O.....+pG|
0x00000A60: 681B4B01 471868DB 20000000 490A4809   |.K.h.h.G... .H.I|
0x00000A70: F7FF4770 F7FFFFFB BD00FB45 E7FDBF20   |pG......E... ...|
0x00000A80: 47184B06 60104A06 F3816801 68408808   |.K.G.J.`.h....@h|
0x00000A90: 00004700 00000B00 00000B00 00000417   |.G..............|
0x00000AA0: 20000000 0F04F01E F3EFBF0C F3EF8108   |... ............|
0x00000AB0: 69888109 78003802 D1032818 0000E000   |...i.8.x.(......|
0x00000AC0: 47104A07 68124A07 6812322C 00004710   |.J.G.J.h,2.h.G..|
0x00000AD0: 4B05B500 4A05681B 4798589B 0000BD00   |...K.h.J.X.G....|
0x00000AE0: 00000377 20000000 00000AF0 00000004   |w...... ........|
0x00000AF0: 00001000 00000000 FFFFFF00 03D09000   |................|
0x00000B00: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000B10: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
~~~~ 중략 ~~~~
0x00000FC0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000FD0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000FE0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000FF0: FFFFFFFF FFFFFFFF 00078000 0007E000   |................|

  

  ▶ 0xFF8 번지에 MBR_BOOTLOADER_ADDR 가 쓰여 있습니다. (nrf_mbr.h 파일 참조)

  ▶ 0xFFC 번지에 MBR_PARAM_PAGE_ADDR 가 쓰여 있습니다. (nrf_mbr.h 파일 참조)

 

  >> bootloader 없는 이미지의 MBR dump 데이타

 

D:\Project\SES\nrfutil>nrfjprog -f nrf52 --memrd 0x0 --n 0x1000 --w 3
0x00000000: 20000400 00000A81 00000715 00000A61   |... ........a...|
0x00000010: 0000071F 00000729 00000733 00000000   |....)...3.......|
0x00000020: 00000000 00000000 00000000 00000AA5   |................|
0x00000030: 0000073D 00000000 00000747 00000751   |=.......G...Q...|
0x00000040: 0000075B 00000765 0000076F 00000779   |[...e...o...y...|
0x00000050: 00000783 0000078D 00000797 000007A1   |................|
0x00000060: 000007AB 000007B5 000007BF 000007C9   |................|
0x00000070: 000007D3 000007DD 000007E7 000007F1   |................|
0x00000080: 000007FB 00000805 0000080F 00000819   |................|
0x00000090: 00000823 0000082D 00000837 00000841   |#...-...7...A...|
0x000000A0: 0000084B 00000855 0000085F 00000869   |K...U..._...i...|
0x000000B0: 00000873 0000087D 00000887 00000891   |s...}...........|
0x000000C0: 0000089B 000008A5 000008AF 000008B9   |................|
0x000000D0: 000008C3 000008CD 000008D7 000008E1   |................|
0x000000E0: 000008EB 000008F5 000008FF 00000909   |................|
0x000000F0: 00000913 0000091D 00000927 00000931   |........'...1...|
0x00000100: 0000093B F000B51F E88DF803 BD1F000F   |;...............|
0x00000110: BCACF000 71FCF640 F04F6808 1C402210   |....@..q.hO.."@.|
0x00000120: 6808D008 D0091C40 1C406808 6808D004   |...h@....h@....h|
0x00000130: BA37F000 E7F56990 E7F96990 B5704770   |..7..i...i..pGp.|
0x00000140: 0B01460B F6004418 0B0470FF 5080F04F   |.F...D...p..O..P|
0x00000150: 03092200 03246903 43436940 46101B1D   |."...i$.@iCC...F|
0x00000160: FA48F000 46204629 4070E8BD BA42F000   |..H.)F F..p@..B.|
0x00000170: F64FB5F0 F44F73FF 461A75B4 E0111E6E   |..O..sO..u.Fn...|
0x00000180: D30142A9 E0004634 1B09460C 7B02F830   |.B..4F...F..0..{|
0x00000190: 443B1E64 D1F9441A EB04B29C B2944313   |d.;D.D.......C..|
0x000001A0: 4212EB04 D1EB2900 EB00B298 EB024013   |...B.).......@..|
0x000001B0: EA404112 BDF04001 B09249F3 E9D14604   |.A@..@...I...F..|
0x000001C0: E9CD0100 22FF0110 46682140 FBF4F000   |......."@!hF....|
0x000001D0: 000FE894 000FE88D A9104668 C804E002   |........hF......|
0x000001E0: 2D04F841 D1FA4288 46682110 FFC0F7FF   |A..-.B...!hF....|
0x000001F0: 20AA9010 0044F88D F999F000 FF8AF7FF   |... ..D.........|
0x00000200: 74FCF640 F04F6820 1C402510 6820D00F   |@..t hO..%@... h|
0x00000210: 46692210 F0003080 6820F978 D0081C40   |."iF.0..x. h@...|
0x00000220: 22086820 F000A910 F000F970 69A8F961   | h."....p...a..i|
0x00000230: 69A8E7EE F04FE7F5 69035080 F6406940   |...i..O..P.i@i@.|
0x00000240: 434371FC F04F6808 1C402210 6808D006   |.qCC.hO.."@....h|
0x00000250: 5080F500 D2034283 47702009 E7F76990   |...P.B... pG.i..|
0x00000260: 1C406808 6808D004 D0031C40 47702000   |.h@....h@.... pG|
0x00000270: E7F96990 47702004 4604B570 4DC36800   |.i... pGp..F.h.M|
0x00000280: D2762807 F000E8DF 29190433 00251E63   |.(v.....3..)c.%.|
0x00000290: 6502E9D4 46296864 F0004630 462AF962   |...edh)F0F..b.*F|
0x000002A0: 46304621 F931F000 462100AA F0004630   |!F0F..1...!F0F..|
0x000002B0: 2800FB57 2003D000 F000BD70 F44FFC09   |W..(... p.....O.|
0x000002C0: E0075080 F0001D20 2800F940 F000D1F4   |.P.. ...@..(....|
0x000002D0: 6860FBFF 20006028 1D24BD70 0007E894   |..`h(`. p.$.....|
0x000002E0: F0000092 2800FB3D 200ED0F6 F7FFBD70   |....=..(... p...|
0x000002F0: 2800FFA2 E9D4D1FA F04F0301 EB005180   |...(......O..Q..|
0x00000300: 69080283 4368694D D80E4282 70F8F640   |...iMihC.B..@..p|
0x00000310: F04F6805 1C6D2210 6805D009 0583EB05   |.hO.."m....h....|
0x00000320: 6949690B 429D434B 2009D903 6955BD70   |.iIiKC.B... p.Ui|
0x00000330: 6801E7F4 D0031C49 1C406800 E003D002   |...hI....h@.....|
0x00000340: E7FA6950 BD70200F F7FF4620 F7FFFF35   |Pi... p. F..5...|
0x00000350: 2800FF72 1D20D1F7 F8F7F000 D1F22800   |r..(.. ......(..|
0x00000360: 28006860 F000D1F0 F7FFF8E2 F000FED3   |`h.(............|
0x00000370: 2007F8BF B510BD70 2818460C 2001D002   |... p....F.(... |
0x00000380: BD106008 F7FF6820 6020FF77 6841BD10   |.`.. h..w. `..Ah|
0x00000390: B1094605 E0002701 F6402700 682074F8   |.F...'...'@..t h|
0x000003A0: 2610F04F D02B1C40 68AA6820 F0000092   |O..&@.+. h.h....|
0x000003B0: B338FAD7 008168A8 1C406820 6820D027   |..8..h.. h@.'. h|
0x000003C0: FEBDF7FF 6820B1D7 D0221C40 F04F6826   |...... h@.".&hO.|
0x000003D0: 68AC5080 6901686D 43516942 D90D42A9   |.P.hmh.iBiQC.B..|
0x000003E0: 69406901 42A14341 4621D908 F0004630   |.i@iAC.B..!F0F..|
0x000003F0: 4622F8B8 46304629 F887F000 F878F000   |.."F)F0F......x.|
0x00000400: E7D26970 F893F000 FE84F7FF 6970E7F6   |pi............pi|
0x00000410: 6976E7D6 F640E7DB 682074FC 2610F04F   |..vi..@..t hO..&|
0x00000420: D0231C40 1C406820 6820D00C D01F1C40   |@.#. h@... h@...|
0x00000430: 68206825 0580F105 D01B1C40 79386827   |%h h....@...'h8y|
0x00000440: D01928AA 70F8F640 1C496801 6801D042   |.(..@..p.hI.B..h|
0x00000450: D0451C49 1C496801 6801D03E 1C496809   |I.E..hI.>..h.hI.|
0x00000460: 6801D03E D0391C49 E03E6800 E7DA69B0   |>..hI.9..h>..i..|
0x00000470: E7DE69B5 E7E269B7 46282110 FE78F7FF   |.i...i...!(F..x.|
0x00000480: 42816839 6820D122 D0051C40 1000F8D4   |9h.B". h@.......|
0x00000490: 0280F101 E00731C0 E7F969B1 CA08B130   |.....1...i..0...|
0x000004A0: 0D04F851 D1014298 E0002001 428A2000   |Q....B... ... .B|
0x000004B0: B158D1F4 B1106828 D0032804 4628E7FE   |..X.(h...(....(F|
0x000004C0: FF65F7FF 68684931 E00E6008 FE22F7FF   |..e.1Ihh.`....".|
0x000004D0: F80EF000 E7BB6971 E7BF6971 E0046970   |....qi..qi..pi..|
0x000004E0: 5080F44F 1C496801 F000D001 E7FEFACB   |O..P.hI.........|
0x000004F0: 8F4FF3BF 68014826 F4014A26 431161E0   |..O.&H.h&J...a.C|
0x00000500: F3BF6001 BF008F4F E92DE7FD 461741F0   |.`..O.....-..A.F|
0x00000510: 4606460D E0062400 68294630 F854F000   |.F.F.$..0F)h..T.|
0x00000520: 1D2D1C64 42BC1D36 E8BDD3F6 F64081F0   |d.-.6..B......@.|
0x00000530: 680170FC D0041C49 0000F8D0 5180F44F   |.p.hI.......O..Q|
0x00000540: F04FE5FD 69802010 F04FE7F8 690A5180   |..O.. .i..O..Q.i|
0x00000550: 68006949 4282434A 2010D801 20004770   |Ii.hJC.B... pG. |
0x00000560: B5704770 4605460C 6680F44F 4628E008   |pGp..F.FO..f..(F|
0x00000570: F817F000 D30542B4 6480F5A4 5580F505   |.....B.....d...U|
0x00000580: D1F42C00 0000BD70 00000AF4 20000000   |.,..p.......... |
0x00000590: E000ED0C 05FA0004 68014814 D0FC2900   |.........H.h.)..|
0x000005A0: 4A134770 60112102 680B4910 D0FC2B00   |pG.J.!.`.I.h.+..|
0x000005B0: 1D1B4B0F 68086018 D0FC2800 60102000   |.K...`.h.(... .`|
0x000005C0: 28006808 4770D0FC B5104B09 601A2201   |.h.(..pG.K...".`|
0x000005D0: 68144A06 D0FC2C00 68106001 D0FC2800   |.J.h.,...`.h.(..|
0x000005E0: 60182000 28006810 BD10D0FC 4001E400   |. .`.h.(.......@|
0x000005F0: 4001E504 460CB570 F0004605 B910F873   |...@p..F.F..s...|
0x00000600: F87EF000 4621B128 E8BD4628 F0004070   |..~.(.!F(F..p@..|
0x00000610: 4621B807 E8BD4628 F0004070 0000B837   |..!F(F..p@..7...|
0x00000620: 2200B57F 92019200 92039202 0B000B0A   |..."............|
0x00000630: 23014669 E00A4402 F0000944 F851061F   |iF.#.D..D.....Q.|
0x00000640: FA035024 4335F606 5024F841 42821C40   |$P....5CA.$P@..B|
0x00000650: 490DD8F2 9A006808 60084310 68011D08   |...I.h...C.`...h|
0x00000660: 43119A01 F0006001 2800F83D 4906D00A   |...C.`..=..(...I|
0x00000670: 68083110 43109A02 1D096008 9A036808   |.1.h...C.`...h..|
0x00000680: 60084310 0000BD7F 40000600 4C0FB530   |.C.`.......@0..L|
0x00000690: BF002200 1302EB04 5800F8D3 F8D3B92D   |.".........X-...|
0x000006A0: B9155804 5808F8D3 1C52B11D D3F12A08   |.X.....X..R..*..|
0x000006B0: 2A08BD30 EB04D2FC F8C21202 F8C30800   |0..*............|
0x000006C0: 20021804 0808F8C3 0000BD30 4001E000   |... ....0......@|
0x000006D0: 5080F04F 0130F8D0 D0012808 47702000   |O..P..0..(... pG|
0x000006E0: 47702001 5080F04F 1130F8D0 D0052906   |. pGO..P..0..)..|
0x000006F0: 0130F8D0 D0011C40 47702000 47702001   |..0.@.... pG. pG|
0x00000700: 5080F04F 0130F8D0 D001280A 47702000   |O..P..0..(... pG|
0x00000710: 47702001 498F2008 58096809 20104708   |. pG. .I.h.X.G. |
0x00000720: 6809498C 47085809 498A2014 58096809   |.I.h.X.G. .I.h.X|
0x00000730: 20184708 68094987 47085809 49852030   |.G. .I.h.X.G0 .I|
0x00000740: 58096809 20384708 68094982 47085809   |.h.X.G8 .I.h.X.G|
0x00000750: 4980203C 58096809 20404708 6809497D   |< .I.h.X.G@ }I.h|
0x00000760: 47085809 497B2044 58096809 20484708   |.X.GD {I.h.X.GH |
0x00000770: 68094978 47085809 4976204C 58096809   |xI.h.X.GL vI.h.X|
0x00000780: 20504708 68094973 47085809 49712054   |.GP sI.h.X.GT qI|
0x00000790: 58096809 20584708 6809496E 47085809   |.h.X.GX nI.h.X.G|
0x000007A0: 496C205C 58096809 20604708 68094969   |\ lI.h.X.G` iI.h|
0x000007B0: 47085809 49672064 58096809 20684708   |.X.Gd gI.h.X.Gh |
0x000007C0: 68094964 47085809 4962206C 58096809   |dI.h.X.Gl bI.h.X|
0x000007D0: 20704708 6809495F 47085809 495D2074   |.Gp _I.h.X.Gt ]I|
0x000007E0: 58096809 20784708 6809495A 47085809   |.h.X.Gx ZI.h.X.G|
0x000007F0: 4958207C 58096809 20804708 68094955   || XI.h.X.G. UI.h|
0x00000800: 47085809 49532084 58096809 20884708   |.X.G. SI.h.X.G. |
0x00000810: 68094950 47085809 494E208C 58096809   |PI.h.X.G. NI.h.X|
0x00000820: 20904708 6809494B 47085809 49492094   |.G. KI.h.X.G. II|
0x00000830: 58096809 20984708 68094946 47085809   |.h.X.G. FI.h.X.G|
0x00000840: 4944209C 58096809 20A04708 68094941   |. DI.h.X.G. AI.h|
0x00000850: 47085809 493F20A4 58096809 20A84708   |.X.G. ?I.h.X.G. |
0x00000860: 6809493C 47085809 493A20AC 58096809   |<I.h.X.G. :I.h.X|
0x00000870: 20B04708 68094937 47085809 493520B4   |.G. 7I.h.X.G. 5I|
0x00000880: 58096809 20B84708 68094932 47085809   |.h.X.G. 2I.h.X.G|
0x00000890: 493020BC 58096809 20C04708 6809492D   |. 0I.h.X.G. -I.h|
0x000008A0: 47085809 492B20C4 58096809 20C84708   |.X.G. +I.h.X.G. |
0x000008B0: 68094928 47085809 492620CC 58096809   |(I.h.X.G. &I.h.X|
0x000008C0: 20D04708 68094923 47085809 492120D4   |.G. #I.h.X.G. !I|
0x000008D0: 58096809 20D84708 6809491E 47085809   |.h.X.G. .I.h.X.G|
0x000008E0: 491C20DC 58096809 20E04708 68094919   |. .I.h.X.G. .I.h|
0x000008F0: 47085809 491720E4 58096809 20E84708   |.X.G. .I.h.X.G. |
0x00000900: 68094914 47085809 491220EC 58096809   |.I.h.X.G. .I.h.X|
0x00000910: 20F04708 6809490F 47085809 490D20F4   |.G. .I.h.X.G. .I|
0x00000920: 58096809 20F84708 6809490A 47085809   |.h.X.G. .I.h.X.G|
0x00000930: 490820FC 58096809 F45F4708 49057080   |. .I.h.X.G_..p.I|
0x00000940: 58096809 00004708 49044803 4B034A02   |.h.X.G...H.I.J.K|
0x00000950: 00004770 20000000 00000B00 00000B00   |pG..... ........|
0x00000960: 0301EA40 079BB510 2A04D10F C810D30D   |@..........*....|
0x00000970: 1F12C908 D0F8429C BA19BA20 D9014288   |.....B.. ....B..|
0x00000980: BD102001 30FFF04F B11ABD10 D00307D3   |. ..O..0........|
0x00000990: E0071C52 BD102000 3B01F810 4B01F811   |R.... .....;...K|
0x000009A0: D1071B1B 3B01F810 4B01F811 D1011B1B   |.......;...K....|
0x000009B0: D1F11E92 BD104618 03FFF002 2203EA43   |.....F......C.."|
0x000009C0: 4202EA42 B805F000 47704770 F04F4770   |B..B....pGpGpGO.|
0x000009D0: 29040200 8012F0C0 0C03F010 801BF000   |...)............|
0x000009E0: 0C04F1CC 0F02F1BC F800BF18 BFA82B01   |.............+..|
0x000009F0: 2B02F820 010CEBA1 B80DF000 7CC1EA5F   | ..+........_..||
0x00000A00: F800BF24 F8002B01 BF482B01 2B01F800   |$....+...+H....+|
0x00000A10: F04F4770 B5000200 46944613 39204696   |pGO......F.F.F 9|
0x00000A20: E8A0BF22 E8A0500C F1B1500C F4BF0120   |"....P...P.. ...|
0x00000A30: 0709AFF7 E8A0BF28 BF48500C F85DC00C   |....(....PH...].|
0x00000A40: 0089EB04 F840BF28 BF082B04 BF484770   |....(.@..+..pGH.|
0x00000A50: 2B02F820 4F80F011 F800BF18 47702B01   | ..+...O.....+pG|
0x00000A60: 681B4B01 471868DB 20000000 490A4809   |.K.h.h.G... .H.I|
0x00000A70: F7FF4770 F7FFFFFB BD00FB45 E7FDBF20   |pG......E... ...|
0x00000A80: 47184B06 60104A06 F3816801 68408808   |.K.G.J.`.h....@h|
0x00000A90: 00004700 00000B00 00000B00 00000417   |.G..............|
0x00000AA0: 20000000 0F04F01E F3EFBF0C F3EF8108   |... ............|
0x00000AB0: 69888109 78003802 D1032818 0000E000   |...i.8.x.(......|
0x00000AC0: 47104A07 68124A07 6812322C 00004710   |.J.G.J.h,2.h.G..|
0x00000AD0: 4B05B500 4A05681B 4798589B 0000BD00   |...K.h.J.X.G....|
0x00000AE0: 00000377 20000000 00000AF0 00000004   |w...... ........|
0x00000AF0: 00001000 00000000 FFFFFF00 03D09000   |................|
0x00000B00: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000B10: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000B20: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000B30: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000B40: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000B50: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000B60: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000B70: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000B80: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
~~~~ 중략 ~~~~
0x00000FC0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000FD0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000FE0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x00000FF0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|

 

 nrfjprog 이용해 덤프하기

D:\Project\SES\nrfutil>nrfjprog -f nrf52 --memrd 0xff0 --n 0x20
0x00000FF0: FFFFFFFF FFFFFFFF 00078000 0007E000   |................|
0x00001000: 200013B8 00025319 0000C119 0002527F   |... .S.......R..|


D:\Project\SES\nrfutil>nrfjprog -f nrf52 --memrd 0x10001000 --n 0x20
0x10001000: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x10001010: FFFFFFFF 00078000 0007E000 FFFFFFFF   |................|

  

< 기타>

A>  Bootloader 모듈 blockdiagram

 

 

B > build Output

Rebuilding ‘secure_bootloader_ble_s132_pca10040’ from solution ‘secure_bootloader_ble_s132_pca10040’ in configuration ‘Release’
1> Assembling ‘thumb_crt0.s’
2> Compiling ‘nrf_log_frontend.c’
3> Compiling ‘nrf_log_str_formatter.c’
4> Compiling ‘app_error_weak.c’
5> Compiling ‘app_scheduler.c’
6> Compiling ‘app_util_platform.c’
7> Compiling ‘crc32.c’
8> Compiling ‘mem_manager.c’
1> Compiling ‘nrf_assert.c’
3> Compiling ‘nrf_atfifo.c’
2> Compiling ‘nrf_atomic.c’
6> Compiling ‘nrf_balloc.c’
7> Compiling ‘nrf_fprintf.c’
5> Compiling ‘nrf_fprintf_format.c’
4> Compiling ‘nrf_fstorage.c’
8> Compiling ‘nrf_fstorage_nvmc.c’
1> Compiling ‘nrf_fstorage_sd.c’
7> Compiling ‘nrf_memobj.c’
2> Compiling ‘nrf_queue.c’
3> Compiling ‘nrf_ringbuf.c’
6> Compiling ‘nrf_section_iter.c’
5> Compiling ‘nrf_strerror.c’
4> Compiling ‘sha256.c’
8> Compiling ‘micro_ecc_backend_ecc.c’
1> Compiling ‘micro_ecc_backend_ecdh.c’
2> Compiling ‘micro_ecc_backend_ecdsa.c’
7> Compiling ‘pb_common.c’
3> Compiling ‘pb_decode.c’
5> Compiling ‘boards.c’
6> Compiling ‘nrf_nvmc.c’
4> Compiling ‘nrfx_atomic.c’
7> Compiling ‘nrf_crypto_ecc.c’
8> Compiling ‘nrf_crypto_ecdsa.c’
1> Compiling ‘nrf_crypto_hash.c’
2> Compiling ‘nrf_crypto_init.c’
5> Compiling ‘nrf_crypto_shared.c’
6> Compiling ‘dfu_public_key.c’
3> Compiling ‘main.c’
4> Compiling ‘ble_srv_common.c’
7> Compiling ‘nrf_bootloader.c’
6> Compiling ‘nrf_bootloader_app_start.c’
1> Compiling ‘nrf_bootloader_app_start_final.c’
8> Compiling ‘nrf_bootloader_dfu_timers.c’
2> Compiling ‘nrf_bootloader_fw_activation.c’
5> Compiling ‘nrf_bootloader_info.c’
3> Compiling ‘nrf_bootloader_wdt.c’
4> Assembling ‘ses_startup_nrf52.s’
6> Assembling ‘ses_startup_nrf_common.s’
1> Compiling ‘system_nrf52.c’
7> Compiling ‘nrf_sw_backend_hash.c’
2> Compiling ‘dfu-cc.pb.c’
4> Compiling ‘nrf_dfu.c’
6> Compiling ‘nrf_dfu_ble.c’
8> Compiling ‘nrf_dfu_flash.c’
5> Compiling ‘nrf_dfu_handling_error.c’
2> Compiling ‘nrf_dfu_mbr.c’
3> Compiling ‘nrf_dfu_req_handler.c’
7> Compiling ‘nrf_dfu_settings.c’
1> Compiling ‘nrf_dfu_settings_svci.c’
8> Compiling ‘nrf_dfu_transport.c’
4> Compiling ‘nrf_dfu_utils.c’
5> Compiling ‘nrf_dfu_validation.c’
2> Compiling ‘nrf_dfu_ver_validation.c’
6> Compiling ‘nrf_dfu_svci.c’
8> Compiling ‘nrf_dfu_svci_handler.c’
7> Compiling ‘nrf_svc_handler.c’
1> Compiling ‘nrf_sdh.c’
4> Compiling ‘nrf_sdh_ble.c’
6> Compiling ‘nrf_sdh_soc.c’
2> Compiling ‘oberon_backend_chacha_poly_aead.c’
7> Compiling ‘oberon_backend_ecc.c’
5> Compiling ‘oberon_backend_ecdh.c’
3> Compiling ‘oberon_backend_ecdsa.c’
8> Compiling ‘oberon_backend_eddsa.c’
1> Compiling ‘oberon_backend_hash.c’
4> Compiling ‘oberon_backend_hmac.c’
1> Generating linker script ‘secure_bootloader_ble_s132_pca10040.ld’
1> Linking secure_bootloader_ble_s132_pca10040.elf
Build complete

 

C> pca10040_s132_ble && pca10040_s132_ble_debug 이미지 크기 비교

  :pca10040_s132_ble

 

  : pca10040_s132_ble_debug 

 

 

D> pca10040_s132ble_debug 프로젝트 사용시 RTT 로그 메시지

<info> app: Inside main
<debug> app: In nrf_bootloader_init
<debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
<debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
<debug> nrf_dfu_settings: Using settings page.
<debug> nrf_dfu_settings: Copying forbidden parts from backup page.
<debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
<info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
<debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
<debug> app: Enter nrf_bootloader_fw_activate
<info> app: No firmware to activate.
<info> app: Boot validation failed. No valid app to boot.
<debug> app: DFU mode because app is not valid.
<info> nrf_bootloader_wdt: WDT is not enabled
<debug> app: in weak nrf_dfu_init_user
<debug> app: timer_stop (0x20005984)
<debug> app: timer_activate (0x20005984)
<info> app: Entering DFU mode.
<debug> app: Initializing transports (found: 1)
<debug> nrf_dfu_ble: Initializing BLE DFU transport
<debug> nrf_dfu_ble: Setting up vector table: 0x00071000
<debug> nrf_dfu_ble: Enabling SoftDevice.
<debug> nrf_dfu_ble: Configuring BLE stack.
<debug> nrf_dfu_ble: Enabling the BLE stack.
<debug> nrf_dfu_ble: No advertising name found
<debug> nrf_dfu_ble: Using default advertising name
<debug> nrf_dfu_ble: Advertising...
<debug> nrf_dfu_ble: BLE DFU transport initialized.
<debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
<debug> app: Enter main loop

 

 E> button  DFU 동작 테스트   

   : Button4 를 이용한 DFU 모드 진입 테스트를 위해 dfu_enter_check() 함수를 고쳐야 합니다.

    #if 0 로 막힌부분은 앱이 존재하고 valid 한지 체킹하는 부분인데 button 테스트를 위해 

    잠시 막고 추후 릴리즈시 원상복귀 하시면 됩니다.

>> .\nRF5_SDK\components\libraries\bootloader\nrf_bootload.c
static bool dfu_enter_check(void)
{
    #if 0
    if (!app_is_valid(crc_on_valid_app_required()))
    {
        NRF_LOG_DEBUG("DFU mode because app is not valid.");
        return true;
    }
    #endif
   ~~~~ 중략 ~~~~
 }

 

  ▶ Button4 (P0.16) 에서 Button3 (P0.15) 으로 변경하기

   

    sdk_config.h 파일만 다음처럼 변경하면 됩니다.

    #define NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN    15       //16

 

  ▶  Default  LOW 일때 DFU 모드로 진입 했는데 HIGH 일때 DFU 진입하게 변경하기

static void dfu_enter_button_init(void)
{
    nrf_gpio_cfg_sense_input(NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN,
                             GPIO_PIN_CNF_PULL_Pulldown,
                             NRF_GPIO_PIN_SENSE_HIGH);
}

static bool dfu_enter_check(void)
{
    ~~~~ 중략 ~~~~
    if (NRF_BL_DFU_ENTER_METHOD_BUTTON &&
       (nrf_gpio_pin_read(NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN) == 1))
    {
        NRF_LOG_DEBUG("DFU mode requested via button.");
        return true;
    }
    ~~~~ 중략 ~~~~  
}

 

 

그럼 수고하세요.

반응형