Monday, January 22nd 2018, 3:25pm UTC+1

You are not logged in.

  • Login
  • Register

ilkay.kozak

Beginner

Date of registration: Jan 26th 2016

Posts: 18

1

Tuesday, January 9th 2018, 7:55pm

Bootloader

Hello,
I use STM32F207VC and my bootloader address is between 0x08000000 and 0x08003FFF .
Application starts at 0x08004000 . But when I start debug , it checks CRC and erases bootloader sectors.
How can I protect bootloader sectors?
Regards,

ilkay KOZAK

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 567

2

Wednesday, January 10th 2018, 9:56am

Hello Ilkay,

Thank you for your inquiry.
J-Link will only reprogram memory sections that have changed. So make sure that your debug build does not generate any code for 0x08000000 - 0x08003FFF.
Could you provide us with a J-Link log file when that happens? https://wiki.segger.com/Enable_J-Link_log_file
Would it be possible for you to send us an example project where this issue is reproducible?

Best regards,
Nino

ilkay.kozak

Beginner

Date of registration: Jan 26th 2016

Posts: 18

3

Friday, January 12th 2018, 2:16pm

Hello Nino,
You can find my elf file attached.

ELF Header is below.
When I connect using Target/Connect J-Link/Verify , it's output is; ( it flashes bank 0 (0x08000000 - 32K )
Connecting ?J-Link? using ?USB?
Connecting to target using SWD
Loaded /Applications/SEGGER Embedded Studio for ARM 3.34/bin/libjlinkarm.dylib
Firmware Version: J-Link Pro V4 compiled Dec 12 2017 14:34:30
DLL Version: 6.22d
Hardware Version: V4.00
Target Voltage: 4.603
Device "STM32F207VE" selected.
Found SW-DP with ID 0x2BA01477
Found SW-DP with ID 0x2BA01477
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x412FC230. Implementer code: 0x41 (ARM)
Found Cortex-M3 r2p0, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 002BB000 SCS
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 002BB002 DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 002BB001 ITM
ROMTbl[0][4]: E0040000, CID: B105900D, PID: 002BB923 TPIU-Lite
ROMTbl[0][5]: E0041000, CID: B105900D, PID: 002BB924 ETM-M3
Downloading ?STM18.elf? to J-Link
Programming 16.7 KB of addresses 08004000 ? 08008327
Programming 0.1 KB of addresses 08008328 ? 080083ef
J-Link: Flash download: Bank 0 @ 0x08000000: 1 range affected (32768 bytes)
J-Link: Flash download: Total time needed: 0.925s (Prepare: 0.012s, Compare: 0.023s, Erase: 0.781s, Program: 0.103s, Verify: 0.000s, Restore: 0.002s)

Download successful-------------------------------------------------------------------------------------------------


But when I try to debug ;


Class: ELF32
Encoding: Little endian
ELFVersion: Current
Type: Executable file
Machine: ARM
Version: Current
Entry: 0x80079e5
Flags: 0x5000200

Section Headers:
[ Nr ] Type Addr Size ES Flg Lk Inf Al Name
[ 0] NULL 00000000 00000000 00 00 000 00
[ 1] PROGBITS 08004000 00004488 00 AX 00 000 04 .text
[ 2] ? (0x70000001) 08008488 00000008 00 A 01 000 04 .ARM.exidx
[ 3] PROGBITS 20000184 000000c8 00 WA 00 000 04 .data
[ 4] NOBITS 20000250 00005a2c 00 WA 00 000 08 .bss
[ 5] ? (0x70000003) 00000000 0000002b 00 00 000 01 .ARM.attributes
[ 6] PROGBITS 00000000 0000007e 01 00 000 01 .comment
[ 7] PROGBITS 00000000 0006c710 00 00 000 01 .debug_info
[ 8] PROGBITS 00000000 0000c3b7 00 00 000 01 .debug_abbrev
[ 9] PROGBITS 00000000 0001443c 00 00 000 01 .debug_loc
[ 10] PROGBITS 00000000 00001b40 00 00 000 08 .debug_aranges
[ 11] PROGBITS 00000000 000026f8 00 00 000 08 .debug_ranges
[ 12] PROGBITS 00000000 0003823b 00 00 000 01 .debug_macro
[ 13] PROGBITS 00000000 0002cd99 00 00 000 01 .debug_line
[ 14] PROGBITS 00000000 0010ff79 01 00 000 01 .debug_str
[ 15] PROGBITS 00000000 000056c0 00 00 000 04 .debug_frame
[ 16] SYMTAB 00000000 00003d80 10 11 265 04 .symtab
[ 17] STRTAB 00000000 0000241b 00 00 000 01 .strtab
[ 18] STRTAB 00000000 000000c3 00 00 000 01 .shstrtab
Key to Flags: W (write), A (alloc), X (execute)


Segment headers:
[ Nr ] Type VirtAddr PhysAddr FileSize Mem.Size Flags Align
[ 0] ? (0x70000001) 08008488 08008488 00000008 00000008 R 00000004
[ 1] LOAD 08004000 08004000 00004490 00004490 RX 00000004
[ 2] LOAD 20000184 08008490 000000c8 000000c8 RW 00000004
[ 3] LOAD 20000250 08008560 00000000 00005a2c RW 00000008
ilkay.kozak has attached the following file:
  • STM18.zip (693.32 kB - 7 times downloaded - Last download: Today, 11:04am)

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 567

4

Friday, January 19th 2018, 4:49pm

Hello Ilkay,

The logs you provided are not helping.
Could you provide a J-Link logfile as described in the wiki? https://wiki.segger.com/Enable_J-Link_log_file

For reference, could you test if debugging the elf in Ozone works? https://www.segger.com/products/developm…-link-debugger/

Create a ne ozone project with the project wizard and select your elf file when asked for the Program File.

Does that work for you?

Best regards,
Nino