Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
EBLink Support for STMF303K8
#11
@vdaniel
Is it working with V3.4?
Reply
#12
Hi embitz,

I tried V3.4 with STM32F334 and received an error:
ERROR: writing sector 0 failed.
The F303 I will try later and inform you.

vdaniel
Reply
#13
F334 is working here

Code:
EBlink version 3.4-[273] by Gerard Zagema

Interface type : STlink/V2.1
STlink connect : Under reset
Target voltage : 3.26V
Interface speed: 4000KHz
Target detected: Cortex-M4 (r0p1) with FPv4_SP
HW breakpoints : 6
HW watchpoints : 4
Fault unwind   : Enabled
STmicro family : STM32F33x
Detected FLASH : 0x0
Configured RAM : 0x4000
GDB listening (0.0.0.0 @ 2331)
GDB connected
Reset: system
Flashing sector  0, address: 0x08000000, length: 0x4000
Flashing sector  1, address: 0x08004000, length: 0x4000
Flashing sector  2, address: 0x08008000, length: 0x2468
Reset: system
Reply
#14
The flash size is not reported but that's also not used for the memory map.
That stm32F3x script should be rewritten to the current "standard"
But all those scripts is a hell of a job to get it initially right

e.g. flash size should be

Code:
    // Get the flash size
    result = itrfApi.readMem32(0x1ffff7cc)
    if(result<0) return result
   
    flash_size = (itrfApi.value32  & 0xffff) *1024
Reply
#15
The same is valid for the stm32F4 script, should also be rewritten.
Reply
#16
Yes, that stm32F3x was totally bogus. It was copied from a other device as template when I initially started this project, 3 years ago. 
It could flash as long as the device was empty because the page sizes were wrong.

Here the script which looks more like it should be (also in the repro and in the current installer3.4 )

Sorry!

p.s. take a look at the script file, I think that it is quite self explanatory.


Attached Files
.zip   stm32f3x.zip (Size: 1.28 KB / Downloads: 3)
Reply
#17
Hi embitz,

I tried with your last script and V3.4:

This interface doesn't support direct 16bit memory access
Please update probe or use other probe

After clicking on Ok:
Target Exception!
[LR]:  0x00000000
[PC]:  0x00000000


After updating the ST-LINK firmware it starts to work
with the nucleo-f303k8 and f334.

But many people have an old clone of ST-LINK, which is not
possible to update, which worked fine with native EmBitz.  If
it is not possible to keep support for old firmware?

vdaniel
Reply
#18
(06-10-2020, 08:00 PM)vdaniel Wrote: Hi embitz,

I tried with your last script and V3.4:

This interface doesn't support direct 16bit memory access
Please update probe or use other probe

After clicking on Ok:
Target Exception!
[LR]:  0x00000000
[PC]:  0x00000000


After updating the ST-LINK firmware it starts to work
with the nucleo-f303k8 and f334.

But many people have an old clone of ST-LINK, which is not
possible to update, which worked fine with native EmBitz.  If
it is not possible to keep support for old firmware?

vdaniel

Hi,

As far as I know, every V2 STlink (also clones with "salvaged" firmware from STmicro) can be updated with new firmware with the latest STutil from STmicro. 
However, I also added the old flash loader (f3_f1_f0.script.alt) in the flash directory. I have to check if it still works. The problem with that one is that if the page size is larger than the max ram size (minus the external bootloader) that bootloader will fail. I have to build a new external bootloader to tackle that, something I just want to avoid.

I would recommend to use probes with direct 16bit memory access because that's the way I will go in the future.

Let me know if you have V2 probes that are not upgradable so I get an idea if this is gone be a problem.

BTW the V3 mini is very cheap and all the disco boards have original V2 links.

P.s. that exception is by design. The last time that the MCU did run was on an empty flash so it crashed and set his exception flags which EBlink catches.
Reply
#19
I rewrited the alternative and tested it. This script first tries to use direct write and if this fails it will use an external bootloader. This was my original idea, however, it's like Murphy, if it fails because of a device with small memory and a old STlink V2 then you are looking for problems which takes always much time to solve.

I really like the direct way which is much more straightforward just as in the reference manuals of the devices. I don't want to support the external loaders any more as I also don't want to support STlink V1 anymore. And again, who can't afford a STlink V3 mini?


Attached Files
.zip   f3_f1_f0.script.zip (Size: 2.81 KB / Downloads: 2)
Reply
#20
Hi embitz,

Thank you very much for the fantastic tool EmBitz.

I will try your last script and inform you.

But I agree with you about your effort. Much better, if you continue the main work forward
to the EmBitz V.2

vdaniel
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)