Hi Andreas.

On Tue, 13 Jan 2015 16:47:58 +0100, Andreas Fritiofson wrote:
> On Tue, Jan 13, 2015 at 3:30 PM, Jens Bauer <jens-li...@gpio.dk> wrote:
>> Does any of this sound familiar to anyone or perhaps ring a bell ?
> 
> Are you sure the chip isn't in reset? Measure the voltage on the 
> reset pin. Is it connected anywhere?

I've pulled NRST up using a 4K7 resistor and it says 3.29V, which is what's 
supplied to the VDD pins.

When connecting it to the JTAG-lock-pick Tiny 2 and when not connecting it; I 
get the same result (pull-up is still enabled in both cases).

> During reset you can access SRAM but on some STM32 family (don't 
> remember which) I have noticed that the flash is inaccessible. Sounds 
> kind of similar, although I'd expect the GPIO registers would not be 
> writable in reset.

It seems I have full access to all hardware registers and all SRAM.

Uhm... The Flexible Memory Controller isn't required for Flash-memory access, 
is it ?
(FMC is disabled in the RCC->AHB3ENR register.

...

> BTW, did you resolve the STM32F407-DISCOVERY problem?

I had no real problems with the STM32F407-based Discovery board after writing 
my 'program' routine like this:

proc unlockNow () {
        stm32f2x unlock 0
        mww 0x40023C08 0x08192A3B; mww 0x40023C08 0x4C5D6E7F; mww 0x40023C14 
0x0fffaaed
}

proc flashNow {file_to_flash} {
        init
        sleep 200

        reset halt
        wait_halt

        unlockNow ()
        flash write_image erase "$file_to_flash"

# The following does not work (yet) for STM32F4 Discovery:
#       flash write_image erase unlock "$file_to_flash"

        reset run
        sleep 10

        shutdown
}

(The "stm32f2x unlock 0" is currently extraneous, but I expect that at some 
point, the workaround will be removed).

-So it's possible to get OpenOCD to flash-program the board, but I think it'll 
be necessary to modify the 'unlock' routine to include the FLASH_OPTCR 
unlocking sequence + writing the value 0x0fffaaed.
(It's probably a good idea to check FLASH_SR, FLASH_CR and perhaps also 
FLASH_OPTCR right after writing the new value).

I did notice that sometimes (on rare occasions), FLASH_OPTCR did go back to 
0x00aaaae1; I have no idea why it did that.
However, my value seem to survive a complete power-off, so it's not changed 
back after a reset or power-cycle.


Love
Jens

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to