Other Parts Discussed in Thread: UNIFLASH, RM46L852, HALCOGEN
On Linux I have installed UniFlash and arm-none-eabi-gcc. I have been working without success to provide a way to prompt for input over a serial terminal using sci similar to how the Launchpad Project_1 example does through:
void sciDisplayText(sciBASE_t *sci, uint8 *text, uint32 length);
See: git.ti.com/.../master in ../Launchpad/RM/RM46L8/Project_1 I am using arm-none-eabi-gcc --version:
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 8-2019-q3-update) 8.3.1 20190703 (release) [gcc-8-branch revision 273027]
(I also have arm-none-eabi-gcc (Arch Repository) 9.2.0 on another box -- same results)
I am using the following source, and building all of the required sources for the ...Init() functions:
#include <math.h>
#include "Application_Types.h"
#include "sys_selftest.h"
#include "sci.h"
#include "gio.h"
#include "rti.h"
#include "het.h"
#include "adc.h"
extern void sciDisplayText(sciBASE_t *sci, uint8 *text, uint32 length);
button USER1 = NONE, USER2 = NONE;
uint32 g_PotReading = 468750;
int main (void) {
char *s = "Hello World!\r\n";
gioInit();
hetInit();
adcInit();
adcCalibration(adcREG1);
rtiInit();
sciInit();
mibspiInit();
mibspiREG3->PC0 &= 0xFFE; //CS0 is GIO
mibspiREG3->PC1 &= 0x6FE; //CS0 is input
mibspiREG3->PC8 |= 0x1; //pull-up CS0
sciDisplayText (scilinREG, (uint8*)s, 105);
sciDisplayText (scilinREG, (uint8*)"All Done...\r\n", 105);
return 0;
}
(I began with sciInit() alone and added the additional ...Init() functions one-by-one in case there was a needed definition contained that would prevent printing that would not be flagged by the compiler or linker)
I am using the following compile string:
arm-none-eabi-gcc -march=armv7-r --specs=nosys.specs --specs=nano.specs -o hello.out hello.c sci.c mibspi.c rti.c sys_vim.c esm.c sys_phantom.c support_functions.c notification.c sys_dma.c gio.c het.c adc.c -lm
The code is successfully compiled to executable:
$ file hello.out
hello.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
And the flash succeeds without issue:
$ ./dslite.sh -c ~/doc/arm/ti_rm46x/RM46L852.ccxml -e /home/david/dev/src-c/tmp/arm/prj01/hello.out
Executing the following command:
> /opt/ti/uniflash_5.1.0/deskdb/content/TICloudAgent/linux/ccs_base/DebugServer/bin/DSLite flash -c /home/david/doc/arm/ti_rm46x/RM46L852.ccxml -e /home/david/dev/src-c/tmp/arm/prj01/hello.out
For more details and examples, please refer to the UniFlash Quick Start guide.
DSLite version 9.2.0.1723
Configuring Debugger (may take a few minutes on first launch)...
Initializing Register Database...
Initializing: IcePick
Executing Startup Scripts: IcePick
Initializing: Dap
Executing Startup Scripts: Dap
Initializing: CortexR4
Executing Startup Scripts: CortexR4
Connecting...
CortexR4: GEL Output: Memory Map Setup for Flash @ Address 0x0Loading Program: /home/david/dev/src-c/tmp/arm/prj01/hello.out
Preparing ...
CortexR4: GEL Output: Memory Map Setup for Flash @ Address 0x0 due to System Reset
.text: 0 of 66556 at 0x94
Erasing Flash
Erasing Bank 0, Sector 0
Erasing Bank 0, Sector 1: 4%
Erasing Bank 0, Sector 2: 9%
Erasing Bank 0, Sector 3: 13%
Erasing Bank 0, Sector 4: 18%
Erasing Bank 0, Sector 5: 22%
Erasing Bank 0, Sector 6: 27%
Erasing Bank 0, Sector 7: 31%
Erasing Bank 0, Sector 8: 36%
Erasing Bank 0, Sector 9: 40%
Erasing Bank 0, Sector 10: 45%
Erasing Bank 0, Sector 11: 50%
Erasing Bank 0, Sector 12: 54%
Erasing Bank 0, Sector 13: 59%
Erasing Bank 0, Sector 14: 63%
Erasing Bank 0, Sector 15: 68%
Erasing Bank 7, Sector 0: 77%
Erasing Bank 7, Sector 1: 81%
Erasing Bank 7, Sector 2: 86%
Erasing Bank 7, Sector 3: 90%
.text: 32748 of 66556 at 0x94: 48%
.text: 65500 of 66556 at 0x94: 96%
.data: 0 of 1052 at 0x20490: 98%
Finished: 98%
CortexR4: GEL Output: Memory Map Setup for Flash @ Address 0x0 due to System Reset
Setting PC to entry point.: 98%
Running...
Success
However, when attached through a serial console (to /dev/ttyACM0 with comm parameters 19200 N82), no output is produced. Flashing the project1_RM46x.out executable, immediately restores the console output). So I am stumped. I have been though the source and header files to ensure my example approaches console output in the same manner -- in fact using the same code, but I must be missing something basic in the compile or link process such that the executable produced does not provide the same serial output as the Project_1 example does.
I'm open to all suggestions, but I can't see what CCS would be doing that results in a working Project_1 with output that arm-none-eabi-gcc and ld are not doing. Any help would be greatly appreciated. I have worn out ti.com (sorry) looking through examples and documentation, but have not found the missing piece.