Update 2012-01-10: the goal of this thread is now to port the StarterWare AM1808 USB Bulk Device example (or similar functionality) to the AM1707 EVM board.
Question 1: Is StarterWare not available for Sitara AM17x? Specifically, AM1705..Answer 1: No, it is not available. See Baskaran's post.
Question 2: Can the uartEcho example (serial port) be ported from AM1808 to run on the AM1707 EVM?Answer 2: Yes. See this post, with source code included as sw_am17x_2012-01-10-UART_interrupt_works!.zip
Question 3: Can the usb_bulk_dev example be ported from AM1808 to run on the AM1707 EVM?Answer 3: Yes. See this post, with source code included as gcc_usb_bulk_dev_am1707.zip
At TI's behest, please post questions about porting other parts of StarterWare in a fresh thread. However, for questions about any existing posts, I think it would make more sense to reply on this thread.
Special thanks to Baskaran, Madhvapathi, Sujith, and Vivek!
Dear Baskaran,
Thank you for your continued support!
Code
char a[12] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb};char *p;int intValue, index;for (index = 0; index <= 12-4; index++){ p = &a[index]; intValue = *((int*) p); printf("*( &a[%d] ) = 0x%x\n", index, intValue);}
Result (for both CCS 4.1.3.00034 [cl470 v4.6.3] + 5.1.0.09000 [cl470 v4.9.1] on EVMAM1707)
*( &a[0] ) = 0x3020100*( &a[1] ) = 0x30201*( &a[2] ) = 0x1000302*( &a[3] ) = 0x2010003*( &a[4] ) = 0x7060504*( &a[5] ) = 0x4070605*( &a[6] ) = 0x5040706*( &a[7] ) = 0x6050407*( &a[8] ) = 0xb0a0908
So I guess this means unaligned memory access is not supported? Is this what you meant by exception? Sorry if I did not understand correctly..
Question, though: isn't "__attribute__ ((packed))" CCS 5.1.0.09000 () for AM1x? cf. usblib.h in StarterWare AM1808 01.00.02.02
Thank you!Jonathan
"Is this what you meant by exception? " - if the unaligned exception is enabled you would have got exception. Since you have not enabled the exception, you just getting the data wrongly.
In usblib.h the packed attribute is applied for ARM architecture V7 only. ARM 9 which is used in AM1808 is v5 architecture. So the packed attribute here will not be applicable for AM1x.
For any new issues i would suggest you to open a new thread. In this thread itself we have discussed lot of issues and the thread has grown too big.
Thank you, Baskaran! If any new issues arise, I will create a new thread; the rest of this post follows up on the previous issue of memory alignment.
You are right--enabling the ARM core's unaligned exception in CCSv5, the board winds up in AbortHandler. Code is posted below because I had to look up how to do this..
char a[12] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb};char *p;int intValue, index;
// enable "Data address alignment fault checking"asm(" mrc p15, #0, r0, c1, c0, #0\n\t" " orr r0, r0, #0x00000002\n\t" " mcr p15, #0, r0, c1, c0, #0\n\t");index = 0;p = &a[index];intValue = *((int*) p);index = 1;p = &a[index];intValue = *((int*) p); // set breakpoint here and (assembly) step into abort handler.
ReferencesARM926EJ-S Technical Reference Manualam1808_starterware/system_config/armv5/cgt/cp15.c: CP15MMUEnable()
Attached is a successful port of the usb_bulk_dev example to AM1707!
It has been confirmed to work with the following setup:
***Please note that other compilers did not work - including older and newer (as of this writing) versions of CodeSourcery, as well as TI's tms470 code generation tools (i.e., the built-in compiler bundled with CCS).
Recipe (from scratch)
--------|Includes| --------include/debug.hinclude/delay.hinclude/psc.hinclude/timer.hinclude/uart.hinclude/uartStdio.hinclude/usb.hinclude/hw/hw_aintc.hinclude/hw/hw_psc_AM1808.hinclude/hw/hw_uart.hinclude/hw/hw_usb.hinclude/hw/hw_usbOtg_AM1808.hinclude/hw/hw_usbphyGS60.hinclude/hw/hw_tmr.hinclude/hw/hw_types.hinclude/hw/soc_AM1808.hinclude/armv5/cpu.hinclude/armv5/am1808/evmAM1808.hinclude/armv5/am1808/interrupt.husblib/include/usblib.husblib/include/usb-ids.husblib/include/usbdevice.husblib/include/usbdbulk.husblib/include/usblibpriv.husblib/include/usbdcomp.husblib/include/usbdevicepriv.hPorted by hand to AM1707------------------------include/hw_syscfg0_AM1808.h - ported to hw_syscfg_AM1707.h using PinSetup.exe + spruh94a.pdf================================================================================================== --------| Source | --------Files from AM1808 StarterWare-----------------------------examples/evmAM1808/usb_dev_bulk/usb_bulk_structs.cexamples/evmAM1808/usb_dev_bulk/usb_bulk_structs.hexamples/evmAM1808/usb_dev_bulk/usb_dev_bulk.c - COMMENTED OUT all graphics code!!examples/evmAM1808/usb_dev_bulk/ustdlib.cexamples/evmAM1808/usb_dev_bulk/ustdlib.hutils/delay.cutils/uartStdio.cusblib/usbbuffer.cusblib/usbdesc.cusblib/usbringbuf.cusblib/usbtick.cusblib/device/usbdbulk.cusblib/device/usbdconfig.cusblib/device/usbdenum.cusblib/device/usbdcdesc.cusblib/device/usbdhandler.cdrivers/psc.cdrivers/timer.cdrivers/uart.cdrivers/usbphyGS60.cdrivers/usb.cplatform/evmAM1808/uartConsole.cplatform/evmAM1808/usb.c - as usb_platform.cplatform/evmAM1808/syscfg.cplatform/evmAM1808/sysdelay.csystem_config/armv5/gcc/cpu.csystem_config/armv5/gcc/init.Ssystem_config/armv5/am1808/interrupt.csystem_config/armv5/am1808/startup.csystem_config/armv5/am1808/gcc/exceptionhandler.Sbuild/armv5/gcc/am1808/evmAM1808/usb_dev_bulk/usb_dev_bulk.ldsPorted to AM1707----------------platform/evmAM1808/uart.c - rewritten as uart_platform.c using new syscfg/pinmux header
Thanks for sharing your experience. I am sure it will help others.
With all the help I've received on these forums, it's the least I could do!
Hi Jonathan Chen,
I am trying USB_DEV_BULK project from OMAPL138_StarterWare_1_10_03_03 on TMDXLCDK138 (OMAP-L138 Development Kit (LCDK)).
The Development Kit was detect at host PC as unknown devjice.
1. May I know how to fix this USB_DEV_BULK error?
2. I also install CodeSourcery 2009q3 (gcc) compiler as suggested by you. What need to set at CCS5.1 so that to use the compiler?
3. I have downloaded GNU ARM Eclipse plug-in (org.eclipse.cdt.cross.arm.gnu_0.5.4.201202210114.zip). May I know how to install it and use it at CCS5.1?
The detail of my set up is below:
1. Eval kit model :TMDXLCDK138 ( OMAP-L138 Development Kit (LCDK) ).
2. Starterware version :OMAPL138_StarterWare_1_10_03_03
3. OS : Win XP SP3
4. CCS Version : 5.1.0.09000
5. Gel file use for target for both DSP and ARM processor : OMAP-L138_LCDK.gel
6. Starterware project file name: usb_dev_bulk_armv5_omapl138_lcdkOMAPL138
Hi Jonathan,
After Install CodeSourcery GCC and CYGWin GCC, USB bulk is enumeration successfully
Verification of USB bulk:
Install program from http://www.ti.com/tool/sw-usb-win, execute usb_bulk_example.exe program from C:\Program Files\Texas Instruments\Stellaris\usb_examples.
When key in x byte data in data entry, the x byte is written into device and later the x byte was read from device.
The counter at LCD for Write and Read back also correct.
Thus, the data transfer of USB Bulk is working fine with verification software.
This meant that USB bulk is able to connect to host PC and transfer in and out data file correctly.
Thank you very much.