comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry Petrey <gpetrey@earthlink.net>
Subject: Re: GNAT SPARK:Embedded ARM Ada Project doesn't run in STM32F429 Discovery Board
Date: Mon, 08 Sep 2014 19:06:18 -0700
Date: 2014-09-08T19:06:18-07:00	[thread overview]
Message-ID: <540e609b$0$5292$b1db1813$46decd27@news.astraweb.com> (raw)
In-Reply-To: <53efb9a8$0$32760$c3e8da3$dbd57e7@news.astraweb.com>

On 8/16/2014 1:05 PM, Jerry Petrey wrote:
> On 8/5/2014 8:13 PM, alexander.ribero.ovalle@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
>>
>
> 1. I have it running on the STM407 Discovery board and on the STM417
> Discovery Board but have not been able to get it on the STM429 board yet
> - that chip is a bit different.
>
> 2. You have to look in the lib->gnat->arm-eabi->ravenscar-sfp-stm32f4
> directory for the startup files. In adainclude, the file setup_pll.adb
> will need some changes as well as s-stm32f.ads, a-intnam.ads, handler.S,
> s-bbbosu.adb, and s-bbpara.ads as far as I can tell. Also the linker
> script stm32f4-rom.ld in the ada adalib directory will need a change due
> to the larger Flash memory.
>
> 3. The clocks are setup in setup_pll.adb
> 4. I think I am getting close to having it run on the 429 board but I am
> not there yet. On the other boards it is great. I have console I/O
> working, as well as USARTs, interrupts and DMA working.
>
> Jerry

Good work.  I got my port to the 429 board working recently as well. 
The voltage scaling issue was what was stopping mine from working before 
but I noticed that it had changed in the 429 series while studying some 
of the documents from ST.  The USARTs work as well on this board.

I now have GNAT Ada working on another board; the F303.  I hope to get 
it on the Nucleo 401 and 411 boards but those are proving rather difficult.

Jerry



  parent reply	other threads:[~2014-09-09  2:06 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
2014-08-16 20:05 ` Jerry Petrey
2014-09-08 21:25   ` gnlnops
2014-09-09  2:06   ` Jerry Petrey [this message]
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