Introduction (or: why I'm dealing with this and why I can't really change it for the time being)
I've been using the Logic PD SOM-M1 as a base for product development. It includes a OMAP L138 (non-secure) processor. The final product is supposed to use the OMAP L138E and encrypt the code. Unfortunately due to pretty all people with relevant experience being overburdened with work there's no time to create a new dedicated board, so I'm stuck using what I currently have. And what I do have consists of:
1 of our development boards with a standard SOM-M1 (which is basically OMAP L138 with flash and RAM stuck on a small board)
1 of our development boards with a SOM-M1 in which the original OMAP L138 was removed and replaced with a secure version
The development board was created in-house about 2 years ago and was dedicated to this project specifically.
Problem
I'm unable to run a very simple test program (light a LED, light a different LED if a button is pressed) on the secure processor.
The program is compiled in CCS 6.1.1 (using ARM TI v5.2.6 compiler), is very simple and was verified to work on the non-secure processor.
I'm uploading the program via UART (AIS created with SecureHexAIS_OMAP-L138.exe v.1.25 and uploaded with GenericSecureUartHost.exe v.1.02)
Here's a log of what UART Host prints:
(File IO): Read 4504 bytes from file C:\Program Files (x86)\Texas Instruments\SecureHexAIS\ledtest.bin.
(Serial Port): Opening COM2 at 115200 baud...
(AIS Parse): Read magic word 0x41504954.
(AIS Parse): Waiting for BOOTME... (power on or reset target now)
(AIS Parse): BOOTME received!
(AIS Parse): Performing Start-Word Sync...
(AIS Parse): Performing Ping Opcode Sync...
(AIS Parse): Processing command 0: 0x58535920.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Secure key loading, entering secure mode.
(AIS Parse): Processing command 1: 0x58535923.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Setting boot exit mode...
(AIS Parse): Set exit mode to 0x00000000.
(AIS Parse): Processing command 2: 0x5853590D.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Executing function...
(AIS Parse): Secure mode; sending signature.
(AIS Parse): Processing command 3: 0x5853590D.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Executing function...
(AIS Parse): Secure mode; sending signature.
(AIS Parse): Processing command 4: 0x5853590D.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Executing function...
(AIS Parse): Secure mode; sending signature.
(AIS Parse): Processing command 5: 0x5853590D.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Executing function...
(AIS Parse): Secure mode; sending signature.
(AIS Parse): Processing command 6: 0x58535907.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading boot table...
(AIS Parse): Secure mode; sending signature.
(AIS Parse): Processing command 7: 0x58535907.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading boot table...
(AIS Parse): Secure mode; sending signature.
(AIS Parse): Processing command 8: 0x58535921.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading encoded section...
(AIS Parse): Loaded 60-Byte section to address 0x80000020.
(AIS Parse): Processing command 9: 0x58535921.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading encoded section...
(AIS Parse): Loaded 3960-Byte section to address 0x8000005C.
(AIS Parse): Processing command 10: 0x58535921.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading encoded section...
(AIS Parse): Loaded 40-Byte section to address 0x800017F0.
(AIS Parse): Processing command 11: 0x58535921.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading encoded section...
(AIS Parse): Loaded 16-Byte section to address 0x80001818.
(AIS Parse): Processing command 12: 0x58535906.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Performing jump and close...
(AIS Parse): Secure mode; sending signature.
(AIS Parse): AIS complete. Jump to address 0x80000E50.
(AIS Parse): Waiting for DONE...
(AIS Parse): Boot completed successfully.
(Serial Port): Closing COM2.
The additional commands in the AIS power up the GPIO, set proper PINMUX for the LEDs, set up GPIO direction for the LEDs and light up one LED (out of 4). The program was supposed to turn this LED off and turn on a different one (I've checked earlier and that LED worked when AIS was used to turned it on)
On the non-secure OMAP L138 everything works as intended. On the secure OMAP L138E the AIS commands work fine, but the program doesn't run (the LED turned on with AIS stays on and no other LEDs light up). I can't even connect to it via JTAG, as CCS returns this error:
ARM9_0: Error connecting to the target: (Error -1063 @ 0x0) Device ID is not recognized or is not supported by driver. Confirm device and emulator configuration is correct, or update device driver. (Emulation package 6.0.83.0)
I'm currently out of ideas on how to fix this. The program itself is put in shared RAM:
SEGMENT ALLOCATION MAP
run origin load origin length init length attrs members
---------- ----------- ---------- ----------- ----- -------
8000005c 8000005c 00000e90 00000e90 r-x
8000005c 8000005c 00000e90 00000e90 r-x .text
80000eec 80000eec 00000818 00000000 rw-
80000eec 80000eec 00000800 00000000 rw- .stack
800016ec 800016ec 00000018 00000000 rw- .data
80001708 80001708 00000038 00000038 r--
80001708 80001708 00000028 00000028 r-- .cinit
80001730 80001730 00000010 00000010 r-- .ovly
ffff0000 80000020 0000003c 0000003c r-x
ffff0000 80000020 0000003c 0000003c r-x .intvecs
The .intvecs section is a remainder of a version where I did hardware init in the program and had to switch to the privileged mode. It's not copied to the run location.
There's also a possibility of the OMAP L138E being damaged or improperly soldered on the SOM board. I'm rather hoping that's not the case (as the secure bootloader seems to be working fine and properly executing any commands sent to it)
Any other information I should include? (I can include the whole project, as it's a simple test rig and contains no sensitive code)