Show Posts
Pages: 1 2 [3] 4 5 6
31  Products / Arduino Due / Re: Arduino IDE 1.5.2 .hex file save path? on: August 10, 2013, 07:00:38 pm
Can you load the .elf file to program via JTAG?

Alternatively, generating the hex file from the elf file is quite easy, it's a command line like:

arm-none-eabi-objcopy -O ihex file.elf file.hex

where objcopy is in the Arduino installation somewhere.
32  Products / Arduino Due / Re: USB bar code Reader on: August 10, 2013, 02:02:05 pm
The bar code may not be a simple keyboard device, it might be a composite device. Check by plugging into windows and look to see if it installs as a HID or composite device. There are utilities like usbview and usbdeview which help here, or you can root around in Device Manager.

If it is simple HID device, then there is a chance to get it working, otherwise you will need Arduino code to handle composite devices.
33  Products / Arduino Due / Re: 4pin debug header on: July 08, 2013, 01:16:47 pm
What kind of debugger can I use on that 4pin debug header?
Would it only work on AVR Studio?

Thanks,
RI

Its a JTAG/SWD header, a common 0.1" connector although an unusual form factor for JTAG. I use the 10 pin JTAG/SWD header.

You'll need a suitable JTAG/SWD adapter, the Segger Jlink EDU version is fairly cheap and works with many IDE's including Atmel Studio. There are several other ways to do it, it is a question of selecting an adapter supported by your IDE, or vice versa.
34  Products / Arduino Due / Re: Minimalistic developing on Linux (C, C++) ; what do I need? on: July 08, 2013, 01:06:13 pm
Some useful links I missed:

GNU Tools for ARM Embedded Processors the toolchain maintained by ARM Ltd

Atmel Software Framework standalone ASF.

Atmel appear to use a git repository internally but only seem to be publish the latest version.

Once installed, you should be able to cd to "... \asf-3.9.1\sam\applications\getting-started\sam3x8e_arduino_due_x\gcc" and run "make". That generates .bin and .hex files which you can download to flash with a tool of your choice.

I have only tried this with windows. For windows you will need some additional unix utilities such as make, uname etc which I think are provided by cygwin/mingw, or I use standalone versions downloaded from :
http://gnuwin32.sourceforge.net/packages/make.htm
and
http://sourceforge.net/projects/unxutils/
35  Products / Arduino Due / Re: Minimalistic developing on Linux (C, C++) ; what do I need? on: July 07, 2013, 03:36:06 pm
I do command line ARM stuff on Windows/Linux. I have been using Codesourcery Lite, now I am using the ARM GNU embedded distro. I have just started working on porting my code to Due/SAM3X8E.

Code:
(1) A compiler toolchain
(2) An upload program
(3) Header files describing the Arduino pinout, memory-mapped data structures, etc.
(4) A basic implementation of libc / libm / libstdc++

The ARM toolchain provides the standard libs as well. You can get header files from the standalone ASF distro, but as you say there is a whole load of other stuff in there.

newlib is a bit more tricky. The standard newlib is too big for smaller MCUs. Various people have rolled their own version with varying levels of features, including Atmel in the ASF, but there is no common/portable newlib light/embedded. It would be difficult to do since embedded environments vary so widely.

36  Products / Arduino Due / Re: Arduino Ethernet Shield compatibility? on: April 01, 2013, 07:40:38 am
It looks to me like the Ethernet Shield is NOT 3.3V compatible, I suggest don't connect it to Due.

There does seem to be an implementation of Ethernet library for Due, whether it works or not is a question. I can't see how it would have been tested with a Due/Ethernet shield, unless there is an unannounced 3.3V version in the works.

ETA: clarify wording
37  Products / Arduino Due / Re: Parallel library for Due External Memory Bus/Static Memory Controller on: March 24, 2013, 07:24:31 am
Hello guys.
Long time reader first time poster.

Im designing my own board for another purpose using the same ATSAM3X chip, and after reading this thread I am still a little confused as to how to setup External ram as a continuation of the internal ram - presumable this is possible.

What I mean by this, assuming that all the control, data and address lines are connected correctly to an external chip, how does the MCU know to point the stack to this external memory once all of the internal 48Kb internal ram is used ? is it automatic after setting some SMC control bit in some register?

If this is not possible, then it requires some memory management in code which is quite annoying. Any help would be appreciated.

Fair question. The external memory appears to the MCU as a block of memory at an address depending on its Chip Select line. (These pins are labelled NCS0-NCS7 on the SAM3X). Typically you would connect CSx to the CS pin on your memory device. The lowest 24 bits of a memory address are decoded by the external memory device, the upper 8 bits are decoded in the memory controller. The locations of the memory sections are shown in Figure 8-1 of the SAM3X User Manual. For example, CS0 maps to 0x60000000.

The second question is how to map the application code to memory regions. This can be done very simply by direct access and setup from the application code, but this method is less flexible. You can allocate dynamic variables at runtime just by setting their address to a hardcoded value correspodning to the external memory. If you want to get automatic placement of variables, then you would need to use the linker.

By changing the linker file, you can specify the additional memory region, and what should go into it. At runtime, RAM variables will be zeroed or initialised with data copied from Flash as necessary. This is part of the Standard C initialisation procedure. With GCC toolchain you may need to edit a startup file to include the additional memory regions.

Note that you will need to edit the startup code to setup the memory controller before letting the code does its memory copying/zeroing. If you put the stack into external memory, you must make sure your startup code does not use it before it is setup! It is probably best to set a temporary stack in internal RAM for the startup code, and then change stack after the external memory is setup. It is simpler though to keep stack in internal memory, and use the external memory for other stuff.

The third question is how to get the application to use the extended memory. This can be done in the linker file, using combination of "pragma section" and the linker file, or explicitly in the application, depending on taste.

If this all seems quite complicated, then you are probably right. It needs good knowledge of the MCU and the toolchain to set the right things at the right point. Once setup, it becomes fairly seamless, but get one tiny thing wrong and it falls over in a heap.

To keep it simple, I would probably use direct setup from the application, and use the external memory as a pool of dynamic buffers for bulk data.
38  Products / Arduino Due / Re: Is their a way in the data sheet or some way to add more program memory to due. on: March 22, 2013, 07:15:27 pm
If you can interface SRAM to SAM3X, then you should be able to interface a NOR Flash and run code direct from Flash (will be slower needing wait states). Other permutations are possible, for example you could read from serial/NAND Flash and copy to RAM etc. You would have to write a small amount of bootstrap code since this type of thing is not directly supported by the toolchain.

I'm not sure how flexible the memory controller on the SAM3X is, but with ARM7 and ARM9 projects I have worked on most RAM and Flash was external, the chips only had a few K of RAM on board.
39  Products / Arduino Due / Re: Solution for the 5V vs 3.3V problem on: March 22, 2013, 07:00:49 pm
Just for interest, here is a board I am working on to interface Due to a 3D printer controller (RAMPS)

http://reprap.org/wiki/File:RAMPS-RIB-Back.jpg
http://reprap.org/wiki/File:RAMPS-RIB-Assembly.jpg

It is application specific, I am using TXS0108 to adapt some signals, with some gate drivers for MOSFETS.

I had trouble finding connectors with the same height, but they seem to connect ok.

Source files on github https://github.com/bobc/bobc_hardware/tree/master/RAMPS-FD
40  Products / Arduino Due / Re: Arduino Due JTAG doesnt work :( on: March 17, 2013, 07:11:20 am
Those messages indicate that the J-link adapter is just not seeing any sensible data on the JTAG pins. Assuming that your hardware is working correctly, then the JTAG pins may not be mapped to JTAG depending on what software is loaded in the SAM3X, a whole chip ERASE should clear that. Another thing that could cause this is a misconnected header. It is worth noting here that the orientation of the JTAG header on the Taiji is 180° opposite to the Due, which could lead to confusion. There is a small dot on the board indicating pin 1, easy to miss.
41  Products / Arduino Due / Re: Sam3x8e temperature on: March 16, 2013, 12:29:49 pm
It's not like it gets hot.. Just a bit warm, something I never experienced with a AVR (maybe because of the freq. that the processor is working with)..

Exactly that, the logic gates consume power when they change state, if you are running at a higher frequency then the chip consumes more power (all other things being equal). 28 degrees is well within normal. Nice work with the temperature chart btw  smiley

Given the fact that you have many more gates in an ARM compared to an AVR and are clocking them 4 times faster, it is pretty good that it does not get hotter. Running at lower voltage (3.3V vs 5V) helps a lot with that, as well as the CPU design. By comparison, the old 486 from Intel needed at least a heatsink to run at similar clock rates, if not active cooling.
42  Products / Arduino Due / Re: dependence of DUE Native USB port transfer speed on data length on: March 15, 2013, 06:27:41 pm
The baudrate does not affect the speed of USB transfer if you are just doing PC to MCU transfers, and are not driving an actual UART.

USB transfer rate is affected by two things, polling interval and packet size. Polling interval in USB High speed is a multiple of 125us, and the max packet size is 1024 bytes for CDC class (interrupt transfers).

That seems to be consistent with your results. To maximise throughput, you need to at least buffer up to 1024 bytes to get the most from each transfer. In the worst case, if you send 1 byte in a transfer, you have to wait at least 125us before being polled again, and that latency kills the transfer rate. Protocols that do short request/response transactions should be avoided, you need a protocol with a streaming mode.

To avoid latency further, use larger buffer sizes, and I mean really large, like 32Kb, or for more efficient use of RAM use a double buffer scheme, so you fill one while the other is transferring, then switch over.

Of course, maximising throughput with large buffers is OK for bulk transfer like data logging, but creates a latency problem if you do small transfers with a request/response protocol, but you need to avoid those anyway.


43  Using Arduino / Microcontrollers / Re: Help with ATSAM3X8E (Due barebones) on: March 10, 2013, 09:47:05 am
I am wondering if your chip has not gone through the erase sequence, which is required to get into the bootloader. The ERASE pin needs to be high during reset and held high for 220ms.

I found with SAM7S my chip could get into a "bricked" state, and doing the erase procedure would recover it, sometimes took more than one go to do it.
44  Products / Arduino Due / Re: Cortex-M Debug Connector on: March 09, 2013, 12:44:19 am
I don't know where the 9-pin format came from, is it created by Segger? It does not seem to be an ARM standard.

Personally I prefer to use a header with a polarised housing. The key pin does the same job, but I am not going around cutting pins off headers... Seems a bad idea to introduce an incompatible standard, for a marginal improvement.
45  Using Arduino / Programming Questions / Re: Quesiton about how to not block processor execution when programming on: March 06, 2013, 05:12:03 pm
I think you would need at least a different variable to record previousMillis for red and blue LEDs.
Pages: 1 2 [3] 4 5 6