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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!news.astraweb.com!border6.newsrouter.astraweb.com!not-for-mail Date: Mon, 08 Sep 2014 19:06:18 -0700 From: Jerry Petrey User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: GNAT SPARK:Embedded ARM Ada Project doesn't run in STM32F429 Discovery Board References: <53efb9a8$0$32760$c3e8da3$dbd57e7@news.astraweb.com> In-Reply-To: <53efb9a8$0$32760$c3e8da3$dbd57e7@news.astraweb.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <540e609b$0$5292$b1db1813$46decd27@news.astraweb.com> Organization: Unlimited download news at news.astraweb.com NNTP-Posting-Host: 365e4496.news.astraweb.com X-Trace: DXC=`NHN8daCi\bJ?XMfTm0i_cL?0kYOcDh@j9[Kj4Y^; PWk>3<:Wm\C]QocaM2E:\o1@e^6Y1B1YmAbf?X:8_cOc2Wdf^=B; n62TQihek`8bKlZce Xref: number.nntp.dca.giganews.com comp.lang.ada:188922 Date: 2014-09-08T19:06:18-07:00 List-Id: 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