From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.43.28.197 with SMTP id rv5mr107342icb.23.1407379266762; Wed, 06 Aug 2014 19:41:06 -0700 (PDT) X-Received: by 10.182.105.101 with SMTP id gl5mr123738obb.4.1407379266579; Wed, 06 Aug 2014 19:41:06 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!h18no15385970igc.0!news-out.google.com!eg1ni558igc.0!nntp.google.com!h18no15385967igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 6 Aug 2014 19:41:06 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=99.224.184.56; posting-account=1sGSewoAAAABLExeWf8EQfa8tzBBdK-D NNTP-Posting-Host: 99.224.184.56 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: GNAT SPARK:Embedded ARM Ada Project doesn't run in STM32F429 Discovery Board From: alexander.ribero.ovalle@gmail.com Injection-Date: Thu, 07 Aug 2014 02:41:06 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:21500 Date: 2014-08-06T19:41:06-07:00 List-Id: On Tuesday, August 5, 2014 11:13:08 PM UTC-4, alexander.r...@gmail.com wrot= e: > Hi: >=20 >=20 >=20 > I downloaded and installed gnat-gpl-2014-arm-elf-windows-bin.exe 123 MB = May 23, 2014, and followed the tutorial instructions. >=20 >=20 >=20 > The application compiles and the debugger is called, and it seems that it= gets programmed on the STM32F4 Discovery board (I have STM32F4 discovery b= oard for the STM32F429 target). Because it is a different board than the on= e for the F401, the LEDs are connected on Port G and not Port D, so I repla= ced the references to Port D with references to Port G. I added the GPIO ba= se addresses for Port G as well. >=20 >=20 >=20 > However, after initializing the debugger and starting the program, the LE= Ds 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 LED= s blink, indicating the the debugger is running, but GPS doesn't show any a= ctivity. >=20 >=20 >=20 > This is what GPS shows: >=20 >=20 >=20 > file C:/GNAT/2014/share/examples/gnat-cross/demo_leds-stm32f4/obj/demo >=20 > Reading symbols from C:/GNAT/2014/share/examples/gnat-cross/demo_leds-stm= 32f4/obj/demo...done. >=20 > Remote debugging using localhost:4242 >=20 > 0x08000cb0 in _start_rom () >=20 > load C:/GNAT/2014/share/examples/gnat-cross/demo_leds-stm32f4/obj/demo >=20 > Loading section .text, size 0x3fc0 lma 0x8000000 >=20 > Loading section .rodata, size 0x538 lma 0x8003fc0 >=20 > Loading section .data, size 0x4ac lma 0x80044f8 >=20 > Start address 0x8000cb0, load size 18852 >=20 > Transfer rate: 7 KB/sec, 4713 bytes/write. >=20 > (gdb) continue >=20 > Continuing. >=20 >=20 >=20 >=20 >=20 >=20 >=20 > This is what st-util shows: >=20 >=20 >=20 >=20 >=20 > C:\Users\admin>st-util >=20 > 2014-08-04T14:09:28 INFO ../src/src/stlink-common.c: Loading device param= eters.. >=20 > .. >=20 > 2014-08-04T14:09:28 INFO ../src/src/stlink-common.c: Device connected is:= F42x and F43x device, id 0x10036419 >=20 > 2014-08-04T14:09:28 INFO ../src/src/stlink-common.c: SRAM size: 0x30000 b= ytes (192 KiB), Flash: 0x200000 bytes (2048 KiB) in pages of 16384 bytes >=20 > Chip ID is 00000419, Core ID is 2ba01477. >=20 > Target voltage is 2891 mV. >=20 > Listening at *:4242... >=20 > KARL - should read back as 0x03, not 60 02 00 00 >=20 > GDB connected. >=20 > 2014-08-04T14:09:36 INFO ../src/src/stlink-common.c: Attempting to write = 16384 ( >=20 > 0x4000) bytes to stm32 address: 134217728 (0x8000000) >=20 > EraseFlash - Sector:0x0 Size:0x4000 >=20 > Flash page at addr: 0x08000000 erased >=20 > 2014-08-04T14:09:37 INFO ../src/src/stlink-common.c: Finished erasing 1 p= ages of 16384 (0x4000) bytes >=20 > 2014-08-04T14:09:37 INFO ../src/src/stlink-common.c: Starting Flash write= for F2/F4 >=20 > 2014-08-04T14:09:37 INFO ../src/src/stlink-common.c: Successfully loaded = flash loader in sram size: 16384 >=20 > 2014-08-04T14:09:37 INFO ../src/src/stlink-common.c: Starting verificatio= n of write complete >=20 > 2014-08-04T14:09:37 INFO ../src/src/stlink-common.c: Flash written and ve= rified! jolly good! >=20 > 2014-08-04T14:09:37 INFO ../src/src/stlink-common.c: Attempting to write = 16384 (0x4000) bytes to stm32 address: 134234112 (0x8004000) >=20 > EraseFlash - Sector:0x1 Size:0x4000 >=20 > Flash page at addr: 0x08004000 erased >=20 > 2014-08-04T14:09:38 INFO ../src/src/stlink-common.c: Finished erasing 1 p= ages of 16384 (0x4000) bytes >=20 > 2014-08-04T14:09:38 INFO ../src/src/stlink-common.c: Starting Flash write= for F2/F4 >=20 > 2014-08-04T14:09:38 INFO ../src/src/stlink-common.c: Successfully loaded = flash loader in sram >=20 > size: 16384 >=20 > 2014-08-04T14:09:38 INFO ../src/src/stlink-common.c: Starting verificatio= n of write complete >=20 > 2014-08-04T14:09:39 INFO ../src/src/stlink-common.c: Flash written and ve= rified! jolly good! >=20 >=20 >=20 > I have the following questions: >=20 >=20 >=20 > 1. Have anyone been able to get the examples running on either F401 or F4= 29 ST Discovery Boards? >=20 >=20 >=20 > 2. Do you have a description of the additional runtime libraries, code, t= hat gets loaded prior to running the actual application. The application se= ems to be stuck somewhere during the initialization? >=20 >=20 >=20 > 3. How is the cpu clock gets initialized? >=20 >=20 >=20 > 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 micr= ocontrollers. >=20 >=20 >=20 >=20 >=20 > Regards, >=20 >=20 >=20 > Alex I got the application working and debugging correctly on the STM32F407 Disc= overy Board. Analysis of the system_stm32f4xx.c file (which, it seems, is used for the r= untime libraries used by GNAT GPL for STM32) indicates that there are subtl= e differences in the clock initialization between the STMF32407 and the STM= 32F429 (PLL settings among others).