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 X-Received: by 10.42.108.130 with SMTP id h2mr41238502icp.12.1436267319371; Tue, 07 Jul 2015 04:08:39 -0700 (PDT) Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!wf20no1310645igc.0!news-out.google.com!t2ni3878igk.0!nntp.google.com!news.glorb.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Arduino Due vs Mac Date: Tue, 07 Jul 2015 12:08:50 +0100 Organization: A noiseless patient Spider Message-ID: References: <587f5ad7-4507-45d0-8e33-ae39d11b2027@googlegroups.com> Mime-Version: 1.0 Injection-Info: mx02.eternal-september.org; posting-host="c762050aff3a30866fa7e79999b14776"; logging-data="7291"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DtafQUpzoOKychho3pXPf8VBPspVPGuY=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:AqqX6MoR+iK4lFDl4r3L0JuR94s= sha1:atuhryurEA//YrF/6BG2MIdg9Qs= Content-Type: text/plain Xref: number.nntp.giganews.com comp.lang.ada:193987 Date: 2015-07-07T12:08:50+01:00 List-Id: Simon Wright writes: > Maciej Sobczak writes: > > What I did do is look again at https://github.com/shumatech/BOSSA.git > and **check out the 'arduino' branch** (and compile with clang, not > GCC!) > >> You should be able to upload any binary to the Arduino Due like this: >> >> $ bossac -e -w -v -U true -p tty.usbmodemfd131 -b program.bin >> >> Note: the USB device is a bit unpredictable, it might be >> tty.usbmodemfd141 or something - I had to check the availability of >> this special file name under /dev before every upload and use the >> actual name that was there. > > If I leave out -U and -p this works (after a long pause while it scans > through /dev/cu.Bluetooth- devices before finding /dev/cu.usbmodem1411 > (this seems stable for the Due programming port on the USB port nearer > the front of the Macbook)). > > Now I have to find out why I'm getting 'Floating point exception: 8", > but this is a huge improvement! Turned out to be an integer division by zero if the number of Flash pages to be written or verified was less than 10. Now progressing to the point of having a blinking LED!! As a matter of interest, I was able to write a simple program initialization in Ada which, with minimal cooperation from the linker script, lets me use gprbuild. The linker script starts ENTRY(program_initialization) MEMORY { flash (RX) : ORIGIN = 0x00080000, LENGTH = 512K sram (RWX) : ORIGIN = 0x20070000, LENGTH = 96K } SECTIONS { .isr_vector : { . = ALIGN(4); LONG(_estack) LONG(program_initialization + 1) FILL(0) KEEP(*(.isr_vector)) } > flash .text 0x00080100: startup.ads: pragma Restrictions (No_Elaboration_Code); package Startup is procedure Program_Initialization with Export, Convention => C, External_Name => "program_initialization", No_Return; end Startup; startup.adb: with System.Storage_Elements; package body Startup is -- Generated by gnatbind. procedure Main with Import, Convention => C, External_Name => "main", No_Return; procedure Program_Initialization is -- The following symbols are set up in the linker script: -- -- _sidata: the start of read/write data in Flash, to be copied -- to SRAM -- _sdata: where read/write data is to be copied to -- _edata: the first address after read/write data in SRAM -- _sbss: the start of BSS (to be initialized to zero) -- _ebss: the first address after BSS. use System.Storage_Elements; Sdata : Storage_Element with Import, Convention => C, External_Name => "_sdata"; Edata : Storage_Element with Import, Convention => C, External_Name => "_edata"; Sbss : Storage_Element with Import, Convention => C, External_Name => "_sbss"; Ebss : Storage_Element with Import, Convention => C, External_Name => "_ebss"; Data_Size : constant Storage_Offset := Edata'Address - Sdata'Address; -- Index from 1 so as to avoid subtracting 1 from the size Data_In_Flash : Storage_Array (1 .. Data_Size) with Import, Convention => C, External_Name => "_sidata"; Data_In_Sram : Storage_Array (1 .. Data_Size) with Import, Convention => C, External_Name => "_sdata"; Bss_Size : constant Storage_Offset := Ebss'Address - Sbss'Address; Bss : Storage_Array (1 .. Bss_Size) with Import, Convention => C, External_Name => "_sbss"; begin Data_In_Sram := Data_In_Flash; Bss := (others => 0); Main; end Program_Initialization; end Startup;