comp.lang.ada
 help / color / mirror / Atom feed
From: alexander.ribero.ovalle@gmail.com
Subject: Re: GNAT SPARK:Embedded ARM Ada Project doesn't run in STM32F429 Discovery Board
Date: Wed, 6 Aug 2014 19:41:06 -0700 (PDT)
Date: 2014-08-06T19:41:06-07:00	[thread overview]
Message-ID: <e87427c4-bc9a-4e34-a5b6-2b322c4a4367@googlegroups.com> (raw)
In-Reply-To: <b3147de5-1c42-48ac-9153-6950f2a31846@googlegroups.com>

On Tuesday, August 5, 2014 11:13:08 PM UTC-4, alexander.r...@gmail.com wrote:
> Hi:
> 
> 
> 
> I downloaded and installed  gnat-gpl-2014-arm-elf-windows-bin.exe 123 MB May 23, 2014, and followed the tutorial instructions.
> 
> 
> 
> The application compiles and the debugger is called, and it seems that it gets programmed on the STM32F4 Discovery board (I have STM32F4 discovery board for the STM32F429 target). Because it is a different board than the one for the F401, the LEDs are connected on Port G and not Port D, so I replaced the references to Port D with references to Port G. I added the GPIO base addresses for Port G as well.
> 
> 
> 
> However, after initializing the debugger and starting the program, the LEDs don't turn on, and the debugger doesn't stop at the breakpoint suggested in the tutorial. It seems that it doesn't do anything. The St-Link COM LEDs blink, indicating the the debugger is running, but GPS doesn't show any activity.
> 
> 
> 
> This is what GPS shows:
> 
> 
> 
> file C:/GNAT/2014/share/examples/gnat-cross/demo_leds-stm32f4/obj/demo
> 
> Reading symbols from C:/GNAT/2014/share/examples/gnat-cross/demo_leds-stm32f4/obj/demo...done.
> 
> Remote debugging using localhost:4242
> 
> 0x08000cb0 in _start_rom ()
> 
> load C:/GNAT/2014/share/examples/gnat-cross/demo_leds-stm32f4/obj/demo
> 
> Loading section .text, size 0x3fc0 lma 0x8000000
> 
> Loading section .rodata, size 0x538 lma 0x8003fc0
> 
> Loading section .data, size 0x4ac lma 0x80044f8
> 
> Start address 0x8000cb0, load size 18852
> 
> Transfer rate: 7 KB/sec, 4713 bytes/write.
> 
> (gdb) continue
> 
> Continuing.
> 
> 
> 
> 
> 
> 
> 
> This is what st-util shows:
> 
> 
> 
> 
> 
> C:\Users\admin>st-util
> 
> 2014-08-04T14:09:28 INFO ../src/src/stlink-common.c: Loading device parameters..
> 
> ..
> 
> 2014-08-04T14:09:28 INFO ../src/src/stlink-common.c: Device connected is: F42x and F43x device, id 0x10036419
> 
> 2014-08-04T14:09:28 INFO ../src/src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x200000 bytes (2048 KiB) in pages of 16384 bytes
> 
> Chip ID is 00000419, Core ID is  2ba01477.
> 
> Target voltage is 2891 mV.
> 
> Listening at *:4242...
> 
> KARL - should read back as 0x03, not 60 02 00 00
> 
> GDB connected.
> 
> 2014-08-04T14:09:36 INFO ../src/src/stlink-common.c: Attempting to write 16384 (
> 
> 0x4000) bytes to stm32 address: 134217728 (0x8000000)
> 
> EraseFlash - Sector:0x0 Size:0x4000
> 
> Flash page at addr: 0x08000000 erased
> 
> 2014-08-04T14:09:37 INFO ../src/src/stlink-common.c: Finished erasing 1 pages of 16384 (0x4000) bytes
> 
> 2014-08-04T14:09:37 INFO ../src/src/stlink-common.c: Starting Flash write for F2/F4
> 
> 2014-08-04T14:09:37 INFO ../src/src/stlink-common.c: Successfully loaded flash loader in sram size: 16384
> 
> 2014-08-04T14:09:37 INFO ../src/src/stlink-common.c: Starting verification of write complete
> 
> 2014-08-04T14:09:37 INFO ../src/src/stlink-common.c: Flash written and verified! jolly good!
> 
> 2014-08-04T14:09:37 INFO ../src/src/stlink-common.c: Attempting to write 16384 (0x4000) bytes to stm32 address: 134234112 (0x8004000)
> 
> EraseFlash - Sector:0x1 Size:0x4000
> 
> Flash page at addr: 0x08004000 erased
> 
> 2014-08-04T14:09:38 INFO ../src/src/stlink-common.c: Finished erasing 1 pages of 16384 (0x4000) bytes
> 
> 2014-08-04T14:09:38 INFO ../src/src/stlink-common.c: Starting Flash write for F2/F4
> 
> 2014-08-04T14:09:38 INFO ../src/src/stlink-common.c: Successfully loaded flash loader in sram
> 
> size: 16384
> 
> 2014-08-04T14:09:38 INFO ../src/src/stlink-common.c: Starting verification of write complete
> 
> 2014-08-04T14:09:39 INFO ../src/src/stlink-common.c: Flash written and verified! jolly good!
> 
> 
> 
> I have the following questions:
> 
> 
> 
> 1. Have anyone been able to get the examples running on either F401 or F429 ST Discovery Boards?
> 
> 
> 
> 2. Do you have a description of the additional runtime libraries, code, that gets loaded prior to running the actual application. The application seems to be stuck somewhere during the initialization?
> 
> 
> 
> 3. How is the cpu clock gets initialized?
> 
> 
> 
> 4. If you have any recommendation to get this example running, please let me know. I am very interested in running Ada projects in embedded ARM microcontrollers.
> 
> 
> 
> 
> 
> Regards,
> 
> 
> 
> Alex

I got the application working and debugging correctly on the STM32F407 Discovery Board.

Analysis of the system_stm32f4xx.c file (which, it seems, is used for the runtime libraries used by GNAT GPL for STM32) indicates that there are subtle differences in the clock initialization between the STMF32407 and the STM32F429 (PLL settings among others).

  parent reply	other threads:[~2014-08-07  2:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06  3:13 GNAT SPARK:Embedded ARM Ada Project doesn't run in STM32F429 Discovery Board alexander.ribero.ovalle
2014-08-06  3:24 ` embeddedrelatedmike
2014-08-07  1:26   ` alexander.ribero.ovalle
2014-08-06  4:53 ` embeddedrelatedmike
2014-08-07  1:23   ` alexander.ribero.ovalle
2014-08-07  2:41 ` alexander.ribero.ovalle [this message]
2014-08-16 20:05 ` Jerry Petrey
2014-09-08 21:25   ` gnlnops
2014-09-09  2:06   ` Jerry Petrey
2014-09-10 20:10     ` gnlnops
2014-09-12 21:34       ` Jerry Petrey
2014-09-14  4:49         ` Anh Vo
2014-09-22 21:07           ` Jerry Petrey
2014-09-14 21:08         ` gnlnops
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox