From: Michal Horn Date: Tue, 7 Aug 2012 14:50:01 +0000 (+0200) Subject: Debugging and rewriting send not to use interrupts, but direct sending. X-Git-Tag: v0.2~216 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/pes-rpp/rpp-test-sw.git/commitdiff_plain/8b8e18fe5fb0da1c6c502a93d988868c8ceb89cf Debugging and rewriting send not to use interrupts, but direct sending. Code cleanup --- diff --git a/CommandStoring.dil b/CommandStoring.dil index a263c7c..4391282 100644 --- a/CommandStoring.dil +++ b/CommandStoring.dil @@ -1,4 +1,4 @@ -# TMS570LS3137ZWT 07/31/12 11:20:55 +# TMS570LS3137ZWT 08/07/12 14:21:44 # ARCH=TMS570LS3137ZWT # diff --git a/Debug/CmdProcTISCI.map b/Debug/CmdProcTISCI.map index 13ccf31..0db61a7 100644 --- a/Debug/CmdProcTISCI.map +++ b/Debug/CmdProcTISCI.map @@ -1,10 +1,10 @@ ****************************************************************************** TMS470 Linker Unix v4.9.1 ****************************************************************************** ->> Linked Mon Aug 6 19:05:36 2012 +>> Linked Tue Aug 7 16:49:31 2012 OUTPUT FILE NAME: -ENTRY POINT SYMBOL: "_c_int00" address: 000045e0 +ENTRY POINT SYMBOL: "_c_int00" address: 00004be0 MEMORY CONFIGURATION @@ -12,25 +12,25 @@ MEMORY CONFIGURATION name origin length used unused attr fill ---------------------- -------- --------- -------- -------- ---- -------- VECTORS 00000000 00000020 00000020 00000000 X - FLASH0 00000020 0017ffe0 000088fc 001776e4 R X + FLASH0 00000020 0017ffe0 000089d0 00177610 R X FLASH1 00180000 00180000 00000000 00180000 R X STACKS 08000000 00001500 00000000 00001500 RW - RAM 08001500 00026b00 00004238 000228c8 RW + RAM 08001500 00026b00 00004234 000228cc RW SEGMENT ALLOCATION MAP run origin load origin length init length attrs members ---------- ----------- ---------- ----------- ----- ------- -00000000 00000000 00008920 00008920 r-x +00000000 00000000 000089f0 000089f0 r-x 00000000 00000000 00000020 00000020 r-x .intvecs - 00000020 00000020 00008040 00008040 r-x .text - 00008060 00008060 000007fc 000007fc r-- .const - 00008860 00008860 000000c0 000000c0 r-- .cinit -08001500 08001500 00004148 00000000 rw- - 08001500 08001500 00004148 00000000 rw- .bss -08005648 08005648 000000f0 000000f0 rw- - 08005648 08005648 000000f0 000000f0 rw- .data + 00000020 00000020 000080dc 000080dc r-x .text + 000080fc 000080fc 00000834 00000834 r-- .const + 00008930 00008930 000000c0 000000c0 r-- .cinit +08001500 08001500 00004144 00000000 rw- + 08001500 08001500 00004144 00000000 rw- .bss +08005644 08005644 000000f0 000000f0 rw- + 08005644 08005644 000000f0 000000f0 rw- .data SECTION ALLOCATION MAP @@ -41,108 +41,109 @@ section page origin length input sections .intvecs 0 00000000 00000020 00000000 00000020 sys_intvecs.obj (.intvecs) -.text 0 00000020 00008040 +.text 0 00000020 000080dc 00000020 000014c8 sys_selftest.obj (.text) 000014e8 00001460 os_tasks.obj (.text) 00002948 00000b48 os_queue.obj (.text) 00003490 00000b18 cmd_proc.obj (.text) 00003fa8 00000638 os_port.obj (.text) - 000045e0 000005a8 sys_startup.obj (.text:retain) - 00004b88 00000520 sci.obj (.text) - 000050a8 0000046c cmdio_tisci.obj (.text) - 00005514 0000043c esm.obj (.text) - 00005950 000003cc cmd_io_line.obj (.text) - 00005d1c 00000384 sys_core.obj (.text) - 000060a0 00000354 commands.obj (.text) - 000063f4 00000348 sci.obj (.text:retain) - 0000673c 00000308 system.obj (.text) - 00006a44 00000300 pinmux.obj (.text) - 00006d44 000002b8 i2str.obj (.text) - 00006ffc 00000240 os_list.obj (.text) - 0000723c 00000220 esm.obj (.text:retain) - 0000745c 000001d4 cmd_io.obj (.text) - 00007630 0000016c os_portasm.obj (.text) - 0000779c 00000150 cmd_proc_run.obj (.text) - 000078ec 00000120 cmd_proc_freertos_tms570.obj (.text) - 00007a0c 000000e8 os_heap.obj (.text) - 00007af4 000000c0 dabort.obj (.text) - 00007bb4 0000009c rtsv7R4_T_be_v3D16_eabi.lib : memcpy_t2.obj (.text) - 00007c50 00000078 : memset_t2.obj (.text) - 00007cc8 00000068 notification.obj (.text) - 00007d30 00000060 rtsv7R4_T_be_v3D16_eabi.lib : copy_decompress_rle.obj (.text) - 00007d90 00000054 : u_div32.obj (.text) - 00007de4 00000050 : atoi.obj (.text) - 00007e34 00000050 : atol.obj (.text) - 00007e84 0000004c : cpy_tbl.obj (.text) - 00007ed0 00000048 sys_main.obj (.text) - 00007f18 00000044 rtsv7R4_T_be_v3D16_eabi.lib : exit.obj (.text) - 00007f5c 00000030 : strncpy.obj (.text) - 00007f8c 00000026 : strncmp.obj (.text) - 00007fb2 00000002 --HOLE-- [fill = 0] - 00007fb4 00000018 : _lock.obj (.text) - 00007fcc 00000016 : strchr.obj (.text) - 00007fe2 00000014 : strlen.obj (.text) - 00007ff6 00000012 : copy_zero_init.obj (.text:decompress:ZI) - 00008008 00000010 : isalnum.obj (.text) - 00008018 00000010 : isdigit.obj (.text) - 00008028 00000010 : isspace.obj (.text) - 00008038 00000010 : strcpy.obj (.text) - 00008048 0000000e : copy_decompress_none.obj (.text:decompress:none) - 00008056 00000006 : copy_decompress_rle.obj (.text:decompress:rle24) - 0000805c 00000004 sys_phantom.obj (.text:retain) + 000045e0 00000600 sci.obj (.text) + 00004be0 000005a8 sys_startup.obj (.text:retain) + 00005188 0000043c esm.obj (.text) + 000055c4 000003cc cmd_io_line.obj (.text) + 00005990 00000384 sys_core.obj (.text) + 00005d14 0000037c cmdio_tisci.obj (.text) + 00006090 00000378 sci.obj (.text:retain) + 00006408 00000308 commands.obj (.text) + 00006710 00000308 system.obj (.text) + 00006a18 00000300 pinmux.obj (.text) + 00006d18 000002b8 i2str.obj (.text) + 00006fd0 00000240 os_list.obj (.text) + 00007210 00000220 esm.obj (.text:retain) + 00007430 000001d4 cmd_io.obj (.text) + 00007604 000001c8 cmd_proc_freertos_tms570.obj (.text) + 000077cc 0000016c os_portasm.obj (.text) + 00007938 00000150 cmd_proc_run.obj (.text) + 00007a88 000000e8 os_heap.obj (.text) + 00007b70 000000c0 dabort.obj (.text) + 00007c30 0000009c rtsv7R4_T_be_v3D16_eabi.lib : memcpy_t2.obj (.text) + 00007ccc 00000088 notification.obj (.text) + 00007d54 00000078 rtsv7R4_T_be_v3D16_eabi.lib : memset_t2.obj (.text) + 00007dcc 00000060 : copy_decompress_rle.obj (.text) + 00007e2c 00000054 : u_div32.obj (.text) + 00007e80 00000050 : atoi.obj (.text) + 00007ed0 00000050 : atol.obj (.text) + 00007f20 0000004c : cpy_tbl.obj (.text) + 00007f6c 00000048 sys_main.obj (.text) + 00007fb4 00000044 rtsv7R4_T_be_v3D16_eabi.lib : exit.obj (.text) + 00007ff8 00000030 : strncpy.obj (.text) + 00008028 00000026 : strncmp.obj (.text) + 0000804e 00000002 --HOLE-- [fill = 0] + 00008050 00000018 : _lock.obj (.text) + 00008068 00000016 : strchr.obj (.text) + 0000807e 00000014 : strlen.obj (.text) + 00008092 00000012 : copy_zero_init.obj (.text:decompress:ZI) + 000080a4 00000010 : isalnum.obj (.text) + 000080b4 00000010 : isdigit.obj (.text) + 000080c4 00000010 : isspace.obj (.text) + 000080d4 00000010 : strcpy.obj (.text) + 000080e4 0000000e : copy_decompress_none.obj (.text:decompress:none) + 000080f2 00000006 : copy_decompress_rle.obj (.text:decompress:rle24) + 000080f8 00000004 sys_phantom.obj (.text:retain) -.const 0 00008060 000007fc - 00008060 00000304 commands.obj (.const:.string) - 00008364 00000204 sys_startup.obj (.const:s_vim_init) - 00008568 00000187 commands.obj (.const) - 000086ef 00000001 --HOLE-- [fill = 0] - 000086f0 00000101 rtsv7R4_T_be_v3D16_eabi.lib : ctype.obj (.const:_ctypes_) - 000087f1 00000003 --HOLE-- [fill = 0] - 000087f4 00000026 commands.obj (.const:$P$T0$1) - 0000881a 00000002 --HOLE-- [fill = 0] - 0000881c 00000023 commands.obj (.const:$P$T1$2) - 0000883f 00000001 --HOLE-- [fill = 0] - 00008840 0000001c cmdio_std_line.obj (.const) +.const 0 000080fc 00000834 + 000080fc 00000304 commands.obj (.const:.string) + 00008400 00000204 sys_startup.obj (.const:s_vim_init) + 00008604 00000187 commands.obj (.const) + 0000878b 00000001 --HOLE-- [fill = 0] + 0000878c 00000101 rtsv7R4_T_be_v3D16_eabi.lib : ctype.obj (.const:_ctypes_) + 0000888d 00000003 --HOLE-- [fill = 0] + 00008890 00000038 cmd_proc_freertos_tms570.obj (.const:$P$T0$1) + 000088c8 00000026 commands.obj (.const:$P$T0$1) + 000088ee 00000002 --HOLE-- [fill = 0] + 000088f0 00000023 commands.obj (.const:$P$T1$2) + 00008913 00000001 --HOLE-- [fill = 0] + 00008914 0000001c cmdio_std_line.obj (.const) -.cinit 0 00008860 000000c0 - 00008860 00000099 (.cinit..data.load) [load image, compression = rle] - 000088f9 00000003 --HOLE-- [fill = 0] - 000088fc 0000000c (__TI_handler_table) - 00008908 00000008 (.cinit..bss.load) [load image, compression = zero_init] - 00008910 00000010 (__TI_cinit_table) +.cinit 0 00008930 000000c0 + 00008930 00000098 (.cinit..data.load) [load image, compression = rle] + 000089c8 0000000c (__TI_handler_table) + 000089d4 00000004 --HOLE-- [fill = 0] + 000089d8 00000008 (.cinit..bss.load) [load image, compression = zero_init] + 000089e0 00000010 (__TI_cinit_table) -.bss 0 08001500 00004148 UNINITIALIZED +.bss 0 08001500 00004144 UNINITIALIZED 08001500 00003fa0 os_heap.obj (.bss:xHeap) 080054a0 00000064 os_tasks.obj (.bss:pxReadyTasksLists) 08005504 00000058 os_tasks.obj (.bss) 0800555c 00000054 cmdio_std_line.obj (.bss:ed_line_in_std) 080055b0 00000054 cmdio_std_line.obj (.bss:ed_line_out_std) - 08005604 00000020 sci.obj (.bss) - 08005624 00000018 cmdio_tisci.obj (.bss) - 0800563c 00000008 cmd_proc_freertos_tms570.obj (.bss) - 08005644 00000004 commands.obj (.bss) + 08005604 0000001c sci.obj (.bss) + 08005620 00000018 cmdio_tisci.obj (.bss) + 08005638 00000008 cmd_proc_freertos_tms570.obj (.bss) + 08005640 00000004 commands.obj (.bss) -.data 0 08005648 000000f0 - 08005648 0000005c commands.obj (.data) - 080056a4 00000030 cmdio_std_line.obj (.data) - 080056d4 00000030 os_tasks.obj (.data) - 08005704 0000001c cmdio_tisci.obj (.data) - 08005720 00000008 rtsv7R4_T_be_v3D16_eabi.lib : _lock.obj (.data) - 08005728 00000008 : exit.obj (.data) - 08005730 00000004 os_heap.obj (.data) - 08005734 00000004 os_port.obj (.data) +.data 0 08005644 000000f0 + 08005644 0000005c commands.obj (.data) + 080056a0 00000030 cmdio_std_line.obj (.data) + 080056d0 00000030 os_tasks.obj (.data) + 08005700 0000001c cmdio_tisci.obj (.data) + 0800571c 00000008 rtsv7R4_T_be_v3D16_eabi.lib : _lock.obj (.data) + 08005724 00000008 : exit.obj (.data) + 0800572c 00000004 os_heap.obj (.data) + 08005730 00000004 os_port.obj (.data) LINKER GENERATED COPY TABLES -__TI_cinit_table @ 00008910 records: 2, size/record: 8, table size: 16 - .data: load addr=00008860, load size=00000099 bytes, run addr=08005648, run size=000000f0 bytes, compression=rle - .bss: load addr=00008908, load size=00000008 bytes, run addr=08001500, run size=00004148 bytes, compression=zero_init +__TI_cinit_table @ 000089e0 records: 2, size/record: 8, table size: 16 + .data: load addr=00008930, load size=00000098 bytes, run addr=08005644, run size=000000f0 bytes, compression=rle + .bss: load addr=000089d8, load size=00000008 bytes, run addr=08001500, run size=00004144 bytes, compression=zero_init LINKER GENERATED HANDLER TABLE -__TI_handler_table @ 000088fc records: 3, size/record: 4, table size: 12 +__TI_handler_table @ 000089c8 records: 3, size/record: 4, table size: 12 index: 0, handler: __TI_zero_init index: 1, handler: __TI_decompress_rle24 index: 2, handler: __TI_decompress_none @@ -152,79 +153,75 @@ GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name address name -------- ---- -00007f19 C$$EXIT -00008910 __TI_CINIT_Base -00008920 __TI_CINIT_Limit -000088fc __TI_Handler_Table_Base -00008908 __TI_Handler_Table_Limit -00006098 __TI_PINIT_Base -0000609c __TI_PINIT_Limit -00008049 __TI_decompress_none -00008057 __TI_decompress_rle24 +00007fb5 C$$EXIT +000089e0 __TI_CINIT_Base +000089f0 __TI_CINIT_Limit +000089c8 __TI_Handler_Table_Base +000089d4 __TI_Handler_Table_Limit +00005d0c __TI_PINIT_Base +00005d10 __TI_PINIT_Limit +000080e5 __TI_decompress_none +000080f3 __TI_decompress_rle24 00000000 __TI_static_base__ -00007ff7 __TI_zero_init -00007c51 __aeabi_memclr -00007c51 __aeabi_memclr4 -00007c51 __aeabi_memclr8 -00007bb5 __aeabi_memcpy -00007bb5 __aeabi_memcpy4 -00007bb5 __aeabi_memcpy8 -00007c53 __aeabi_memset -00007c53 __aeabi_memset4 -00007c53 __aeabi_memset8 -00007d90 __aeabi_uidivmod +00008093 __TI_zero_init +00007d55 __aeabi_memclr +00007d55 __aeabi_memclr4 +00007d55 __aeabi_memclr8 +00007c31 __aeabi_memcpy +00007c31 __aeabi_memcpy4 +00007c31 __aeabi_memcpy8 +00007d57 __aeabi_memset +00007d57 __aeabi_memset4 +00007d57 __aeabi_memset8 +00007e2c __aeabi_uidivmod ffffffff __binit__ ffffffff __c_args__ -000045e0 _c_int00 -08005728 _cleanup_ptr -00005fc0 _coreClearAuxiliaryDataFault_ -00005fdc _coreClearAuxiliaryInstructionFault_ -00005f88 _coreClearDataFaultAddress_ -00005f50 _coreClearDataFault_ -00005fa4 _coreClearInstructionFaultAddress_ -00005f6c _coreClearInstructionFault_ -00005eb4 _coreDisableEventBusExport_ -00005f18 _coreDisableFlashEcc_ -00005ee4 _coreDisableRamEcc_ -00005e9c _coreEnableEventBusExport_ -00005efc _coreEnableFlashEcc_ -00005f30 _coreEnableIrqVicOffset_ -00005ecc _coreEnableRamEcc_ -00005e84 _coreEnableVfp_ -00005fb8 _coreGetAuxiliaryDataFault_ -00005fd4 _coreGetAuxiliaryInstructionFault_ -00005f80 _coreGetDataFaultAddress_ -00005f48 _coreGetDataFault_ -00005f9c _coreGetInstructionFaultAddress_ -00005f64 _coreGetInstructionFault_ -00005d1c _coreInitRegisters_ -00005e1c _coreInitStackPointer_ -000086f0 _ctypes_ -00007af4 _dabort -00005ff8 _disable_FIQ_interrupt_ -00006000 _disable_IRQ_interrupt_ -00005ff0 _disable_interrupt_ -0800572c _dtors_ptr -00006008 _enable_interrupt_ -00006010 _esmCcmErrorsClear_ -00005e68 _getCPSRValue_ -00005e70 _gotoCPUIdle_ -08005720 _lock +00004be0 _c_int00 +08005724 _cleanup_ptr +00005c34 _coreClearAuxiliaryDataFault_ +00005c50 _coreClearAuxiliaryInstructionFault_ +00005bfc _coreClearDataFaultAddress_ +00005bc4 _coreClearDataFault_ +00005c18 _coreClearInstructionFaultAddress_ +00005be0 _coreClearInstructionFault_ +00005b28 _coreDisableEventBusExport_ +00005b8c _coreDisableFlashEcc_ +00005b58 _coreDisableRamEcc_ +00005b10 _coreEnableEventBusExport_ +00005b70 _coreEnableFlashEcc_ +00005ba4 _coreEnableIrqVicOffset_ +00005b40 _coreEnableRamEcc_ +00005af8 _coreEnableVfp_ +00005c2c _coreGetAuxiliaryDataFault_ +00005c48 _coreGetAuxiliaryInstructionFault_ +00005bf4 _coreGetDataFaultAddress_ +00005bbc _coreGetDataFault_ +00005c10 _coreGetInstructionFaultAddress_ +00005bd8 _coreGetInstructionFault_ +00005990 _coreInitRegisters_ +00005a90 _coreInitStackPointer_ +0000878c _ctypes_ +00007b70 _dabort +00005c6c _disable_FIQ_interrupt_ +00005c74 _disable_IRQ_interrupt_ +00005c64 _disable_interrupt_ +08005728 _dtors_ptr +00005c7c _enable_interrupt_ +00005c84 _esmCcmErrorsClear_ +00005adc _getCPSRValue_ +00005ae4 _gotoCPUIdle_ +0800571c _lock 00000138 _memoryInit_ -00007fc1 _nop -00007fbb _register_lock -00007fb5 _register_unlock -08005724 _unlock -00007f1d abort +0000805d _nop +00008057 _register_lock +00008051 _register_unlock +08005720 _unlock +00007fb9 abort 00000e28 adc1ParityCheck 00000e94 adc2ParityCheck -00007de5 atoi -00007e35 atol +00007e81 atoi +00007ed1 atol ffffffff binit -00005330 buf_getc -000052a8 buf_putc -00005448 buf_read -000053a0 buf_write 00000f00 can1ParityCheck 00000f80 can2ParityCheck 00001010 can3ParityCheck @@ -234,59 +231,59 @@ ffffffff binit 00000978 checkB1RAMECC 00000a98 checkFlashECC 000006d8 checkefcSelfTest -0000527c clearBuffer -0000525c clearInputBuffer -0000526c clearOutputBuffer -00008688 cmd_des_char -000086a0 cmd_des_charmid -000085f8 cmd_des_error -00008568 cmd_des_help -000086b8 cmd_des_hiddedn -00008670 cmd_des_num -000085c8 cmd_des_opchar_test -00008628 cmd_des_opchar_testro -00008610 cmd_des_param -00008658 cmd_des_prefix -00008640 cmd_des_test -000085e0 cmd_des_testio -00008580 cmd_des_val -00008598 cmd_des_valro -000085b0 cmd_des_valwo +00005f0c clearBuffer +00005eec clearInputBuffer +00005efc clearOutputBuffer +00008724 cmd_des_char +0000873c cmd_des_charmid +00008694 cmd_des_error +00008604 cmd_des_help +00008754 cmd_des_hiddedn +0000870c cmd_des_num +00008664 cmd_des_opchar_test +000086c4 cmd_des_opchar_testro +000086ac cmd_des_param +000086f4 cmd_des_prefix +000086dc cmd_des_test +0000867c cmd_des_testio +0000861c cmd_des_val +00008634 cmd_des_valro +0000864c cmd_des_valwo 00003da0 cmd_do_help 00003bd8 cmd_do_rw_int 00003c78 cmd_do_rw_long 00003b38 cmd_do_rw_short 00003ab4 cmd_do_stamp -00006300 cmd_do_test -00006348 cmd_do_testcmdio -000062e4 cmd_do_testerror -000060a0 cmd_do_testopchar -0000620c cmd_do_testparam -000059c0 cmd_ed_line_buf -08005704 cmd_io_buf -00005bf0 cmd_io_line_in -00005af8 cmd_io_line_out -00005ad8 cmd_io_line_putc -00005cc8 cmd_io_line_rdline -000074a0 cmd_io_puts -000075ac cmd_io_read_bychar -00008840 cmd_io_std_line -00007534 cmd_io_write_bychar -080056a0 cmd_list -08005648 cmd_list_1 -08005660 cmd_list_2 -08005680 cmd_list_main +00006620 cmd_do_test +00006664 cmd_do_testcmdio +00006604 cmd_do_testerror +00006408 cmd_do_testopchar +00006548 cmd_do_testparam +00005634 cmd_ed_line_buf +08005700 cmd_io_buf +00005864 cmd_io_line_in +0000576c cmd_io_line_out +0000574c cmd_io_line_putc +0000593c cmd_io_line_rdline +00007474 cmd_io_puts +00007580 cmd_io_read_bychar +00008914 cmd_io_std_line +00007508 cmd_io_write_bychar +0800569c cmd_list +08005644 cmd_list_1 +0800565c cmd_list_2 +0800567c cmd_list_main 000039e4 cmd_num_suffix 00003968 cmd_opchar_check 00003d18 cmd_opchar_replong -000077d8 cmd_processor_run -00007e85 copy_in +00007974 cmd_processor_run +00007f21 copy_in 00000224 cpuSelfTest 00000b68 cpuSelfTestFail 00000b60 custom_dabort 00000be0 dmaParityCheck -080056a4 ed_line_buf_in_std -080056bc ed_line_buf_out_std +080056a0 ed_line_buf_in_std +080056b8 ed_line_buf_out_std 0800555c ed_line_in_std 080055b0 ed_line_out_std 000005a0 efcCheck @@ -294,54 +291,56 @@ ffffffff binit 00000774 efcClass2Error 000006b0 efcSelfTest 000005fc efcStuckZeroTest -000056c4 esmActivateNormalOperation -000057b0 esmClearStatus -000057f0 esmClearStatusBuffer -00005688 esmDisableError -00005700 esmDisableInterrupt -0000565c esmEnableError -000056d4 esmEnableInterrupt -00005640 esmError -0000583c esmGetStatus -000058a0 esmGetStatusBuffer -00007cc8 esmGroup1Notification -00007cd4 esmGroup2Notification -0000723c esmHighInterrupt -00005514 esmInit -00007380 esmLowInterrupt -0000581c esmSetCounterPreloadValue -0000572c esmSetInterruptLevel -000056b4 esmTriggerErrorPinReset -00007f25 exit +00005338 esmActivateNormalOperation +00005424 esmClearStatus +00005464 esmClearStatusBuffer +000052fc esmDisableError +00005374 esmDisableInterrupt +000052d0 esmEnableError +00005348 esmEnableInterrupt +000052b4 esmError +000054b0 esmGetStatus +00005514 esmGetStatusBuffer +00007ccc esmGroup1Notification +00007cd8 esmGroup2Notification +00007210 esmHighInterrupt +00005188 esmInit +00007354 esmLowInterrupt +00005490 esmSetCounterPreloadValue +000053a0 esmSetInterruptLevel +00005328 esmTriggerErrorPinReset +00007fc1 exit 00000b58 flashClass1Error 00000b5c flashClass2Error 00000778 fmcBus2Check 0000084c fmcClass1Error 00000850 fmcClass2Error 000007b4 fmcECCcheck -08005604 g_sciTransfer +08005608 g_sciTransfer +00005df4 genericPrint +00005dac genericRead 00000c54 het1ParityCheck 00000d30 het2ParityCheck 00000cbc htu1ParityCheck 00000db4 htu2ParityCheck -00006d44 i2str -08005630 inBuffer -000078ec initCmdProc -000050a8 initIoBuffer -00008009 isalnum -00008019 isdigit -00008029 isspace -00007ed0 main -00006850 mapClocks -00007bb5 memcpy -00007ce0 memoryPort0TestFailNotification -00007cf8 memoryPort1TestFailNotification -00007c59 memset +00006d18 i2str +0800562c inBuffer +00007604 initCmdProc +00005d14 initIoBuffer +000080a5 isalnum +000080b5 isdigit +000080c5 isspace +00007f6c main +00006824 mapClocks +00007c31 memcpy +00007ce4 memoryPort0TestFailNotification +00007cfc memoryPort1TestFailNotification +00007d5d memset 000010a4 mibspi1ParityCheck 0000118c mibspi3ParityCheck 00001284 mibspi5ParityCheck -00006a44 muxInit -08005624 outBuffer +00006a18 muxInit +08005620 outBuffer 000004ec pbistIsTestCompleted 00000508 pbistIsTestPassed 00000544 pbistPortTestStatus @@ -349,73 +348,73 @@ ffffffff binit 000002a4 pbistSelfCheck 000003e0 pbistSelfCheckFail 000004bc pbistStop -000067f8 periphInit -0000805c phantomInterrupt -000051d4 print -00005130 printToInputBuffer -00005108 printToOutputBuffer +000067cc periphInit +000080f8 phantomInterrupt +00005d74 print 00003544 proc_cmd_line -000079b0 processCmd -0800563c processCmdHandler -08005640 prompt -00007a0c pvPortMalloc -080056d4 pxCurrentTCB +0000775c processCmd +08005638 processCmdHandler +0800563c prompt +00007a88 pvPortMalloc +080056d0 pxCurrentTCB 00003fa8 pxPortInitialiseStack -00005198 read -00005178 readFromInputBuffer -00005158 readFromOutputBuffer -00004f68 sciDisableLoopback -00004fec sciDisableNotification -00004f34 sciEnableLoopback -00004f84 sciEnableNotification -000063f4 sciHighLevelInterrupt -00004b88 sciInit -00004e38 sciIsRxReady -00004cfc sciIsTxReady -00006580 sciLowLevelInterrupt -00007d10 sciNotification -00004eac sciReceive -00004e84 sciReceiveByte -00004e54 sciRxError -00004d48 sciSend -00004d18 sciSendByte -00004c7c sciSetBaudrate -00004c5c sciSetFunctional -000067b8 setupFlash -0000673c setupPLL +00005d94 read +00004aa0 sciDisableLoopback +00004b2c sciDisableNotification +00004a6c sciEnableLoopback +00004ac4 sciEnableNotification +00006090 sciHighLevelInterrupt +000045e0 sciInit +000048b0 sciIsRxReady +00004754 sciIsTxReady +00006224 sciLowLevelInterrupt +00007d14 sciNotification +00004924 sciReceive +000048fc sciReceiveByte +000048cc sciRxError +000047a0 sciSend +00004770 sciSendByte +000046d4 sciSetBaudrate +000046b4 sciSetFunctional +0000678c setupFlash +00006710 setupPLL 00003510 skip_white 0000017c stcSelfCheck 00000b64 stcSelfCheckFail -00007fcd strchr -00008039 strcpy -00007fe3 strlen -00007f8d strncmp -00007f5d strncpy -00006928 systemInit -000069b4 systemPowerDown +00008069 strchr +000080d5 strcpy +0000807f strlen +00008029 strncmp +00007ff9 strncpy +000068fc systemInit +00006988 systemPowerDown 00000a90 tcramClass1Error 00000a94 tcramClass2Error -00006770 trimLPO -08005734 ulCriticalNesting +00005f8c tisci_getc +00005f54 tisci_putc +00006000 tisci_read +00005fbc tisci_write +00006744 trimLPO +08005730 ulCriticalNesting 000030bc uxQueueMessagesWaiting 000030e0 uxQueueMessagesWaitingFromISR 00001ebc uxTaskGetNumberOfTasks 0000269c uxTaskGetStackHighWaterMark 0000184c uxTaskPriorityGet -00006ffc vListInitialise -00007054 vListInitialiseItem -000070f4 vListInsert -00007070 vListInsertEnd -000071b8 vListRemove +00006fd0 vListInitialise +00007028 vListInitialiseItem +000070c8 vListInsert +00007044 vListInsertEnd +0000718c vListRemove 0000449c vPortEndScheduler 000044a0 vPortEnterCritical 000044b8 vPortExitCritical -00007ab4 vPortFree -00007ac4 vPortInitialiseBlocks -00007630 vPortStartFirstTask -00007788 vPortYield -00007664 vPortYieldProcessor -000076ec vPreemptiveTick +00007b30 vPortFree +00007b40 vPortInitialiseBlocks +000077cc vPortStartFirstTask +00007924 vPortYield +00007800 vPortYieldProcessor +00007888 vPreemptiveTick 00003100 vQueueDelete 000017e4 vTaskDelay 000016e8 vTaskDelayUntil @@ -432,9 +431,9 @@ ffffffff binit 00001a2c vTaskSuspend 00001cf4 vTaskSuspendAll 000020a8 vTaskSwitchContext -08005644 val +08005640 val 00000b6c vimParityCheck -00007ad4 xPortGetFreeHeapSize +00007b50 xPortGetFreeHeapSize 00004488 xPortStartScheduler 00002948 xQueueCreate 00002b34 xQueueCreateCountingSemaphore @@ -561,206 +560,204 @@ address name 0000449c vPortEndScheduler 000044a0 vPortEnterCritical 000044b8 vPortExitCritical -000045e0 _c_int00 -00004b88 sciInit -00004c5c sciSetFunctional -00004c7c sciSetBaudrate -00004cfc sciIsTxReady -00004d18 sciSendByte -00004d48 sciSend -00004e38 sciIsRxReady -00004e54 sciRxError -00004e84 sciReceiveByte -00004eac sciReceive -00004f34 sciEnableLoopback -00004f68 sciDisableLoopback -00004f84 sciEnableNotification -00004fec sciDisableNotification -000050a8 initIoBuffer -00005108 printToOutputBuffer -00005130 printToInputBuffer -00005158 readFromOutputBuffer -00005178 readFromInputBuffer -00005198 read -000051d4 print -0000525c clearInputBuffer -0000526c clearOutputBuffer -0000527c clearBuffer -000052a8 buf_putc -00005330 buf_getc -000053a0 buf_write -00005448 buf_read -00005514 esmInit -00005640 esmError -0000565c esmEnableError -00005688 esmDisableError -000056b4 esmTriggerErrorPinReset -000056c4 esmActivateNormalOperation -000056d4 esmEnableInterrupt -00005700 esmDisableInterrupt -0000572c esmSetInterruptLevel -000057b0 esmClearStatus -000057f0 esmClearStatusBuffer -0000581c esmSetCounterPreloadValue -0000583c esmGetStatus -000058a0 esmGetStatusBuffer -000059c0 cmd_ed_line_buf -00005ad8 cmd_io_line_putc -00005af8 cmd_io_line_out -00005bf0 cmd_io_line_in -00005cc8 cmd_io_line_rdline -00005d1c _coreInitRegisters_ -00005e1c _coreInitStackPointer_ -00005e68 _getCPSRValue_ -00005e70 _gotoCPUIdle_ -00005e84 _coreEnableVfp_ -00005e9c _coreEnableEventBusExport_ -00005eb4 _coreDisableEventBusExport_ -00005ecc _coreEnableRamEcc_ -00005ee4 _coreDisableRamEcc_ -00005efc _coreEnableFlashEcc_ -00005f18 _coreDisableFlashEcc_ -00005f30 _coreEnableIrqVicOffset_ -00005f48 _coreGetDataFault_ -00005f50 _coreClearDataFault_ -00005f64 _coreGetInstructionFault_ -00005f6c _coreClearInstructionFault_ -00005f80 _coreGetDataFaultAddress_ -00005f88 _coreClearDataFaultAddress_ -00005f9c _coreGetInstructionFaultAddress_ -00005fa4 _coreClearInstructionFaultAddress_ -00005fb8 _coreGetAuxiliaryDataFault_ -00005fc0 _coreClearAuxiliaryDataFault_ -00005fd4 _coreGetAuxiliaryInstructionFault_ -00005fdc _coreClearAuxiliaryInstructionFault_ -00005ff0 _disable_interrupt_ -00005ff8 _disable_FIQ_interrupt_ -00006000 _disable_IRQ_interrupt_ -00006008 _enable_interrupt_ -00006010 _esmCcmErrorsClear_ -00006098 __TI_PINIT_Base -0000609c __TI_PINIT_Limit -000060a0 cmd_do_testopchar -0000620c cmd_do_testparam -000062e4 cmd_do_testerror -00006300 cmd_do_test -00006348 cmd_do_testcmdio -000063f4 sciHighLevelInterrupt -00006580 sciLowLevelInterrupt -0000673c setupPLL -00006770 trimLPO -000067b8 setupFlash -000067f8 periphInit -00006850 mapClocks -00006928 systemInit -000069b4 systemPowerDown -00006a44 muxInit -00006d44 i2str -00006ffc vListInitialise -00007054 vListInitialiseItem -00007070 vListInsertEnd -000070f4 vListInsert -000071b8 vListRemove -0000723c esmHighInterrupt -00007380 esmLowInterrupt -000074a0 cmd_io_puts -00007534 cmd_io_write_bychar -000075ac cmd_io_read_bychar -00007630 vPortStartFirstTask -00007664 vPortYieldProcessor -000076ec vPreemptiveTick -00007788 vPortYield -000077d8 cmd_processor_run -000078ec initCmdProc -000079b0 processCmd -00007a0c pvPortMalloc -00007ab4 vPortFree -00007ac4 vPortInitialiseBlocks -00007ad4 xPortGetFreeHeapSize -00007af4 _dabort -00007bb5 __aeabi_memcpy -00007bb5 __aeabi_memcpy4 -00007bb5 __aeabi_memcpy8 -00007bb5 memcpy -00007c51 __aeabi_memclr -00007c51 __aeabi_memclr4 -00007c51 __aeabi_memclr8 -00007c53 __aeabi_memset -00007c53 __aeabi_memset4 -00007c53 __aeabi_memset8 -00007c59 memset -00007cc8 esmGroup1Notification -00007cd4 esmGroup2Notification -00007ce0 memoryPort0TestFailNotification -00007cf8 memoryPort1TestFailNotification -00007d10 sciNotification -00007d90 __aeabi_uidivmod -00007de5 atoi -00007e35 atol -00007e85 copy_in -00007ed0 main -00007f19 C$$EXIT -00007f1d abort -00007f25 exit -00007f5d strncpy -00007f8d strncmp -00007fb5 _register_unlock -00007fbb _register_lock -00007fc1 _nop -00007fcd strchr -00007fe3 strlen -00007ff7 __TI_zero_init -00008009 isalnum -00008019 isdigit -00008029 isspace -00008039 strcpy -00008049 __TI_decompress_none -00008057 __TI_decompress_rle24 -0000805c phantomInterrupt -00008568 cmd_des_help -00008580 cmd_des_val -00008598 cmd_des_valro -000085b0 cmd_des_valwo -000085c8 cmd_des_opchar_test -000085e0 cmd_des_testio -000085f8 cmd_des_error -00008610 cmd_des_param -00008628 cmd_des_opchar_testro -00008640 cmd_des_test -00008658 cmd_des_prefix -00008670 cmd_des_num -00008688 cmd_des_char -000086a0 cmd_des_charmid -000086b8 cmd_des_hiddedn -000086f0 _ctypes_ -00008840 cmd_io_std_line -000088fc __TI_Handler_Table_Base -00008908 __TI_Handler_Table_Limit -00008910 __TI_CINIT_Base -00008920 __TI_CINIT_Limit +000045e0 sciInit +000046b4 sciSetFunctional +000046d4 sciSetBaudrate +00004754 sciIsTxReady +00004770 sciSendByte +000047a0 sciSend +000048b0 sciIsRxReady +000048cc sciRxError +000048fc sciReceiveByte +00004924 sciReceive +00004a6c sciEnableLoopback +00004aa0 sciDisableLoopback +00004ac4 sciEnableNotification +00004b2c sciDisableNotification +00004be0 _c_int00 +00005188 esmInit +000052b4 esmError +000052d0 esmEnableError +000052fc esmDisableError +00005328 esmTriggerErrorPinReset +00005338 esmActivateNormalOperation +00005348 esmEnableInterrupt +00005374 esmDisableInterrupt +000053a0 esmSetInterruptLevel +00005424 esmClearStatus +00005464 esmClearStatusBuffer +00005490 esmSetCounterPreloadValue +000054b0 esmGetStatus +00005514 esmGetStatusBuffer +00005634 cmd_ed_line_buf +0000574c cmd_io_line_putc +0000576c cmd_io_line_out +00005864 cmd_io_line_in +0000593c cmd_io_line_rdline +00005990 _coreInitRegisters_ +00005a90 _coreInitStackPointer_ +00005adc _getCPSRValue_ +00005ae4 _gotoCPUIdle_ +00005af8 _coreEnableVfp_ +00005b10 _coreEnableEventBusExport_ +00005b28 _coreDisableEventBusExport_ +00005b40 _coreEnableRamEcc_ +00005b58 _coreDisableRamEcc_ +00005b70 _coreEnableFlashEcc_ +00005b8c _coreDisableFlashEcc_ +00005ba4 _coreEnableIrqVicOffset_ +00005bbc _coreGetDataFault_ +00005bc4 _coreClearDataFault_ +00005bd8 _coreGetInstructionFault_ +00005be0 _coreClearInstructionFault_ +00005bf4 _coreGetDataFaultAddress_ +00005bfc _coreClearDataFaultAddress_ +00005c10 _coreGetInstructionFaultAddress_ +00005c18 _coreClearInstructionFaultAddress_ +00005c2c _coreGetAuxiliaryDataFault_ +00005c34 _coreClearAuxiliaryDataFault_ +00005c48 _coreGetAuxiliaryInstructionFault_ +00005c50 _coreClearAuxiliaryInstructionFault_ +00005c64 _disable_interrupt_ +00005c6c _disable_FIQ_interrupt_ +00005c74 _disable_IRQ_interrupt_ +00005c7c _enable_interrupt_ +00005c84 _esmCcmErrorsClear_ +00005d0c __TI_PINIT_Base +00005d10 __TI_PINIT_Limit +00005d14 initIoBuffer +00005d74 print +00005d94 read +00005dac genericRead +00005df4 genericPrint +00005eec clearInputBuffer +00005efc clearOutputBuffer +00005f0c clearBuffer +00005f54 tisci_putc +00005f8c tisci_getc +00005fbc tisci_write +00006000 tisci_read +00006090 sciHighLevelInterrupt +00006224 sciLowLevelInterrupt +00006408 cmd_do_testopchar +00006548 cmd_do_testparam +00006604 cmd_do_testerror +00006620 cmd_do_test +00006664 cmd_do_testcmdio +00006710 setupPLL +00006744 trimLPO +0000678c setupFlash +000067cc periphInit +00006824 mapClocks +000068fc systemInit +00006988 systemPowerDown +00006a18 muxInit +00006d18 i2str +00006fd0 vListInitialise +00007028 vListInitialiseItem +00007044 vListInsertEnd +000070c8 vListInsert +0000718c vListRemove +00007210 esmHighInterrupt +00007354 esmLowInterrupt +00007474 cmd_io_puts +00007508 cmd_io_write_bychar +00007580 cmd_io_read_bychar +00007604 initCmdProc +0000775c processCmd +000077cc vPortStartFirstTask +00007800 vPortYieldProcessor +00007888 vPreemptiveTick +00007924 vPortYield +00007974 cmd_processor_run +00007a88 pvPortMalloc +00007b30 vPortFree +00007b40 vPortInitialiseBlocks +00007b50 xPortGetFreeHeapSize +00007b70 _dabort +00007c31 __aeabi_memcpy +00007c31 __aeabi_memcpy4 +00007c31 __aeabi_memcpy8 +00007c31 memcpy +00007ccc esmGroup1Notification +00007cd8 esmGroup2Notification +00007ce4 memoryPort0TestFailNotification +00007cfc memoryPort1TestFailNotification +00007d14 sciNotification +00007d55 __aeabi_memclr +00007d55 __aeabi_memclr4 +00007d55 __aeabi_memclr8 +00007d57 __aeabi_memset +00007d57 __aeabi_memset4 +00007d57 __aeabi_memset8 +00007d5d memset +00007e2c __aeabi_uidivmod +00007e81 atoi +00007ed1 atol +00007f21 copy_in +00007f6c main +00007fb5 C$$EXIT +00007fb9 abort +00007fc1 exit +00007ff9 strncpy +00008029 strncmp +00008051 _register_unlock +00008057 _register_lock +0000805d _nop +00008069 strchr +0000807f strlen +00008093 __TI_zero_init +000080a5 isalnum +000080b5 isdigit +000080c5 isspace +000080d5 strcpy +000080e5 __TI_decompress_none +000080f3 __TI_decompress_rle24 +000080f8 phantomInterrupt +00008604 cmd_des_help +0000861c cmd_des_val +00008634 cmd_des_valro +0000864c cmd_des_valwo +00008664 cmd_des_opchar_test +0000867c cmd_des_testio +00008694 cmd_des_error +000086ac cmd_des_param +000086c4 cmd_des_opchar_testro +000086dc cmd_des_test +000086f4 cmd_des_prefix +0000870c cmd_des_num +00008724 cmd_des_char +0000873c cmd_des_charmid +00008754 cmd_des_hiddedn +0000878c _ctypes_ +00008914 cmd_io_std_line +000089c8 __TI_Handler_Table_Base +000089d4 __TI_Handler_Table_Limit +000089e0 __TI_CINIT_Base +000089f0 __TI_CINIT_Limit 0800555c ed_line_in_std 080055b0 ed_line_out_std -08005604 g_sciTransfer -08005624 outBuffer -08005630 inBuffer -0800563c processCmdHandler -08005640 prompt -08005644 val -08005648 cmd_list_1 -08005660 cmd_list_2 -08005680 cmd_list_main -080056a0 cmd_list -080056a4 ed_line_buf_in_std -080056bc ed_line_buf_out_std -080056d4 pxCurrentTCB -08005704 cmd_io_buf -08005720 _lock -08005724 _unlock -08005728 _cleanup_ptr -0800572c _dtors_ptr -08005734 ulCriticalNesting +08005608 g_sciTransfer +08005620 outBuffer +0800562c inBuffer +08005638 processCmdHandler +0800563c prompt +08005640 val +08005644 cmd_list_1 +0800565c cmd_list_2 +0800567c cmd_list_main +0800569c cmd_list +080056a0 ed_line_buf_in_std +080056b8 ed_line_buf_out_std +080056d0 pxCurrentTCB +08005700 cmd_io_buf +0800571c _lock +08005720 _unlock +08005724 _cleanup_ptr +08005728 _dtors_ptr +08005730 ulCriticalNesting ffffffff __binit__ ffffffff __c_args__ ffffffff binit -[302 symbols] +[300 symbols] diff --git a/Debug/CmdProcTISCI.out b/Debug/CmdProcTISCI.out index e653d7e..a3829d6 100644 Binary files a/Debug/CmdProcTISCI.out and b/Debug/CmdProcTISCI.out differ diff --git a/Debug/source/cmd_proc_freertos_tms570.obj b/Debug/source/cmd_proc_freertos_tms570.obj index af5e9c2..cb67160 100644 Binary files a/Debug/source/cmd_proc_freertos_tms570.obj and b/Debug/source/cmd_proc_freertos_tms570.obj differ diff --git a/Debug/source/cmd_proc_run.obj b/Debug/source/cmd_proc_run.obj index f906655..624d920 100644 Binary files a/Debug/source/cmd_proc_run.obj and b/Debug/source/cmd_proc_run.obj differ diff --git a/Debug/source/cmdio_tisci.obj b/Debug/source/cmdio_tisci.obj index 1fa1444..ab1e5b1 100644 Binary files a/Debug/source/cmdio_tisci.obj and b/Debug/source/cmdio_tisci.obj differ diff --git a/Debug/source/cmdio_tisci.pp b/Debug/source/cmdio_tisci.pp index 6f231ac..68ea61a 100644 --- a/Debug/source/cmdio_tisci.pp +++ b/Debug/source/cmdio_tisci.pp @@ -14,6 +14,8 @@ source/cmdio_tisci.obj: ../include/sys_core.h source/cmdio_tisci.obj: ../include/sys_common.h source/cmdio_tisci.obj: ../include/os_queue.h source/cmdio_tisci.obj: ../include/os_semphr.h +source/cmdio_tisci.obj: ../include/sci.h +source/cmdio_tisci.obj: ../include/gio.h ../source/cmdio_tisci.c: ../include/cmdio_tisci.h: @@ -29,3 +31,5 @@ source/cmdio_tisci.obj: ../include/os_semphr.h ../include/sys_common.h: ../include/os_queue.h: ../include/os_semphr.h: +../include/sci.h: +../include/gio.h: diff --git a/Debug/source/commands.obj b/Debug/source/commands.obj index 06c4c31..85c55c4 100644 Binary files a/Debug/source/commands.obj and b/Debug/source/commands.obj differ diff --git a/Debug/source/commands.pp b/Debug/source/commands.pp index 2d91cce..194ea5d 100644 --- a/Debug/source/commands.pp +++ b/Debug/source/commands.pp @@ -14,6 +14,8 @@ source/commands.obj: ../include/os_mpu_wrappers.h source/commands.obj: ../include/sys_core.h source/commands.obj: ../include/os_queue.h source/commands.obj: ../include/os_semphr.h +source/commands.obj: ../include/sci.h +source/commands.obj: ../include/gio.h source/commands.obj: /opt/ti/ccsv5/tools/compiler/tms470_4.9.1/include/string.h source/commands.obj: /opt/ti/ccsv5/tools/compiler/tms470_4.9.1/include/linkage.h source/commands.obj: /opt/ti/ccsv5/tools/compiler/tms470_4.9.1/include/stdio.h @@ -33,6 +35,8 @@ source/commands.obj: /opt/ti/ccsv5/tools/compiler/tms470_4.9.1/include/stdarg.h ../include/sys_core.h: ../include/os_queue.h: ../include/os_semphr.h: +../include/sci.h: +../include/gio.h: /opt/ti/ccsv5/tools/compiler/tms470_4.9.1/include/string.h: /opt/ti/ccsv5/tools/compiler/tms470_4.9.1/include/linkage.h: /opt/ti/ccsv5/tools/compiler/tms470_4.9.1/include/stdio.h: diff --git a/Debug/source/esm.obj b/Debug/source/esm.obj index ef4aa97..d68f750 100644 Binary files a/Debug/source/esm.obj and b/Debug/source/esm.obj differ diff --git a/Debug/source/notification.obj b/Debug/source/notification.obj index 5299805..af70b6c 100644 Binary files a/Debug/source/notification.obj and b/Debug/source/notification.obj differ diff --git a/Debug/source/os_croutine.obj b/Debug/source/os_croutine.obj index 2b17edf..af36954 100644 Binary files a/Debug/source/os_croutine.obj and b/Debug/source/os_croutine.obj differ diff --git a/Debug/source/os_heap.obj b/Debug/source/os_heap.obj index fc00ad4..c71f567 100644 Binary files a/Debug/source/os_heap.obj and b/Debug/source/os_heap.obj differ diff --git a/Debug/source/os_list.obj b/Debug/source/os_list.obj index 531d59a..61b9dde 100644 Binary files a/Debug/source/os_list.obj and b/Debug/source/os_list.obj differ diff --git a/Debug/source/os_port.obj b/Debug/source/os_port.obj index 311a349..dc9e989 100644 Binary files a/Debug/source/os_port.obj and b/Debug/source/os_port.obj differ diff --git a/Debug/source/os_queue.obj b/Debug/source/os_queue.obj index 6acbd17..76a5172 100644 Binary files a/Debug/source/os_queue.obj and b/Debug/source/os_queue.obj differ diff --git a/Debug/source/os_tasks.obj b/Debug/source/os_tasks.obj index 5aa2c40..8f22924 100644 Binary files a/Debug/source/os_tasks.obj and b/Debug/source/os_tasks.obj differ diff --git a/Debug/source/os_timer.obj b/Debug/source/os_timer.obj index 1acb2bd..9c3bd94 100644 Binary files a/Debug/source/os_timer.obj and b/Debug/source/os_timer.obj differ diff --git a/Debug/source/pinmux.obj b/Debug/source/pinmux.obj index 12b108e..7ef8229 100644 Binary files a/Debug/source/pinmux.obj and b/Debug/source/pinmux.obj differ diff --git a/Debug/source/sci.obj b/Debug/source/sci.obj index 8abde98..fd45947 100644 Binary files a/Debug/source/sci.obj and b/Debug/source/sci.obj differ diff --git a/Debug/source/sys_main.obj b/Debug/source/sys_main.obj index 1729f46..1ed5b73 100644 Binary files a/Debug/source/sys_main.obj and b/Debug/source/sys_main.obj differ diff --git a/Debug/source/sys_phantom.obj b/Debug/source/sys_phantom.obj index d6fe28a..43b9b5d 100644 Binary files a/Debug/source/sys_phantom.obj and b/Debug/source/sys_phantom.obj differ diff --git a/Debug/source/sys_selftest.obj b/Debug/source/sys_selftest.obj index d5b0c55..a48ea9a 100644 Binary files a/Debug/source/sys_selftest.obj and b/Debug/source/sys_selftest.obj differ diff --git a/Debug/source/sys_startup.obj b/Debug/source/sys_startup.obj index 3f99ecf..29406c4 100644 Binary files a/Debug/source/sys_startup.obj and b/Debug/source/sys_startup.obj differ diff --git a/Debug/source/system.obj b/Debug/source/system.obj index 60748ce..f41efb0 100644 Binary files a/Debug/source/system.obj and b/Debug/source/system.obj differ diff --git a/include/cmd_proc_freertos_tms570.h b/include/cmd_proc_freertos_tms570.h index 2fa1136..0439d81 100644 --- a/include/cmd_proc_freertos_tms570.h +++ b/include/cmd_proc_freertos_tms570.h @@ -18,17 +18,16 @@ #include "os_portmacro.h" -/** Initializes CmdProc library, IO stack and creates tasks for FreeRTOS. +/** Initializes CmdProc library, IO stack and creates task for FreeRTOS. * SCI must be initialized before calling this procedure. * - * @param[in] priority priorities for tasks. - * @param[in] introText string shown once after initialization before prompt is shown. - * @param[in] promptText string shown when software is ready to read command from RS-232 + * @param[in] priority priority for main task. + * @param[in] introText string shown once after initialization before prompt is shown. Can be NULL. + * @param[in] promptText string shown when software is ready to read command from RS-232. Can be NULL. */ void initCmdProc(unsigned portBASE_TYPE printPriority, uint8_t * intro, uint8_t * prompt); -/** Procedure for task processCmd. Waits for semaphore, which indicates that command line is prepared for processing. - * After semaphore is given, calls cmdProc function that process the command line +/** Procedure for task processCmd. Infinite loop that reads and process commands. */ void processCmd(void *pvParameters ); diff --git a/include/cmdio_tisci.h b/include/cmdio_tisci.h index 34555d1..2b5fd1d 100644 --- a/include/cmdio_tisci.h +++ b/include/cmdio_tisci.h @@ -11,11 +11,13 @@ #define CMDIO_BUFFER_H_ #define MAX_BUFFER_LEN 128 +#define errBUFFER_NOT_INITIALIZED -6 #include "cmd_proc.h" #include "FreeRTOS.h" #include "os_queue.h" #include "os_semphr.h" +#include "sci.h" typedef struct { @@ -29,78 +31,62 @@ typedef struct { */ void initIoBuffer(); -/** Print string into an output buffer. Let it be blocking or nonblocking in case the buffer is full. - * @param[in] string String to be printed into buffer - * @param[in] length number of characters to be printed - * @param[in] ticks Number of FreeRTOS's ticks to block task, when buffer is full. portMAX_DELAY can be used. - * @return pdPASS when OK; errQUEUE_FULL when buffer is full and ran out of block time. - */ -portBASE_TYPE printToOutputBuffer(const uint8_t * string, uint32_t length, portTickType ticks); - -/** Print string into an input buffer. Let it be blocking or nonblocking in case the buffer is full. - * @param[in] string String to be printed into buffer +/** Print string into an output buffer in a not blocking way. + * @param[in] string String to be printed into output buffer * @param[in] length number of characters to be printed - * @param[in] ticks Number of FreeRTOS's ticks to block task, when buffer is full. portMAX_DELAY can be used. - * @return pdPASS when OK; errQUEUE_FULL when buffer is full and ran out of block time. - */ -portBASE_TYPE printToInputBuffer(const uint8_t * string, uint32_t length, portTickType ticks); - -/** Read character from an output buffer. Let it be blocking or nonblocking in case the buffer is empty. - * @param[out] ch Character read from buffer - * @param[in] ticks Number of FreeRTOS's ticks to block task, when buffer is empty. portMAX_DELAY can be used. - * @return pdPASS when OK; errQUEUE_EMPTY when buffer is empty and ran out of block time. + * @return pdPASS when OK; errQUEUE_FULL when buffer is full, errBUFFER_NOT_INITIALIZED when initIoBuffer function was not called before */ -portBASE_TYPE readFromOutputBuffer(uint8_t * ch, portTickType ticks); +portBASE_TYPE print(const uint8_t * string, uint32_t length); -/** Read character from an input buffer. Let it be blocking or nonblocking in case the buffer is empty. +/** Read character from an input buffer in a blocking way * @param[out] ch Character read from buffer - * @param[in] ticks Number of FreeRTOS's ticks to block task, when buffer is full. portMAX_DELAY can be used. - * @return pdPASS when OK; errQUEUE_EMPTY when buffer is empty and ran out of block time. + * @return pdPASS when OK; errQUEUE_EMPTY when buffer is empty and ran out of block time, errBUFFER_NOT_INITIALIZED when initIoBuffer function was not called before. */ -portBASE_TYPE readFromInputBuffer(uint8_t * ch, portTickType ticks); +portBASE_TYPE read(uint8_t * ch); /** Read character from a buffer. Let it be blocking or nonblocking in case the buffer is empty. * @param[in] buffer Pointer to buffer from which will be read. * @param[out] ch Character read from buffer - * @param[in] ticks Number of FreeRTOS's ticks to block task, when buffer is empty. portMAX_DELAY can be used. - * @return pdPASS when OK; errQUEUE_EMPTY when buffer is empty and ran out of block time. + * @return pdPASS when OK; errQUEUE_EMPTY when buffer is empty and ran out of block time, errBUFFER_NOT_INITIALIZED when initIoBuffer function was not called before. */ -portBASE_TYPE read(tBuffer* buffer, uint8_t * ch, portTickType ticks); +portBASE_TYPE genericRead(tBuffer* buffer, uint8_t * ch); /** Print string to a buffer. Let it be blocking or nonblocking in case the buffer is full. * @param[in] buffer Pointer to buffer from which will be read. * @param[in] string String to be printed into buffer * @param[in] length number of characters to be printed - * @param[in] ticks Number of FreeRTOS's ticks to block task, when buffer is full. portMAX_DELAY can be used. - * @return pdPASS when OK; errQUEUE_FULL when buffer is full and ran out of block time. + * @return pdPASS when OK; errQUEUE_FULL when buffer is full and ran out of block time, errBUFFER_NOT_INITIALIZED when initIoBuffer function was not called before. */ -portBASE_TYPE print(tBuffer* buffer, const uint8_t * string, uint32_t length, portTickType ticks); +portBASE_TYPE genericPrint(tBuffer* buffer, const uint8_t * string, uint32_t length); /** Makes input buffer empty + * @return pdPass when success, errBUFFER_NOT_INITIALIZED when initIoBuffer function was not called before */ -void clearInputBuffer(); +portBASE_TYPE clearInputBuffer(); /** Makes output buffer empty + * @return pdPass when success, errBUFFER_NOT_INITIALIZED when initIoBuffer function was not called before */ -void clearOutputBuffer(); +portBASE_TYPE clearOutputBuffer(); /** Makes buffer empty * @param[in] buffer Buffer to be cleared + * @return pdPass when success, errBUFFER_NOT_INITIALIZED when initIoBuffer function was not called before */ -void clearBuffer(tBuffer * buffer); +portBASE_TYPE clearBuffer(tBuffer * buffer); /** Puts character into output buffer. Is blocking, when buffer is full. * @param[in] cmd_io IO stack pointer * @param[in] ch Character to be printed * @return 1 when succes, 0 when fail */ -int buf_putc(cmd_io_t *cmd_io, int ch); +int tisci_putc(cmd_io_t *cmd_io, int ch); /** Gets character from input buffer, is blocking when buffer is empty. * @param[in] cmd_io IO stack pointer * @return read character */ -int buf_getc(cmd_io_t *cmd_io); +int tisci_getc(cmd_io_t *cmd_io); /** Writes string into output buffer, is blocking when buffer is full. * @param[in] cmd_io IO stack pointer @@ -108,7 +94,7 @@ int buf_getc(cmd_io_t *cmd_io); * @param[in] count Number of character to be written * @return number of written characters */ -int buf_write(cmd_io_t *cmd_io, const void *buf, int count); +int tisci_write(cmd_io_t *cmd_io, const void *buf, int count); /** Reads string from input buffer, is blocking when buffer is empty. * @param[in] cmd_io IO stack pointer @@ -116,7 +102,7 @@ int buf_write(cmd_io_t *cmd_io, const void *buf, int count); * @param[in] count Number of character to be read * @return number of read characters */ -int buf_read(cmd_io_t *cmd_io, void *buf, int count); +int tisci_read(cmd_io_t *cmd_io, void *buf, int count); #endif /* CMDIO_BUFFER_H_ */ diff --git a/source/cmd_proc_freertos_tms570.c b/source/cmd_proc_freertos_tms570.c index 121bc9f..c31c6fd 100644 --- a/source/cmd_proc_freertos_tms570.c +++ b/source/cmd_proc_freertos_tms570.c @@ -4,7 +4,7 @@ * Created on: 1.8.2012 * Author: Michal Horn * - * All stuff that are needed for input commands via RS-232, processing command using CmdProc library and printing output back on RS-232. + * Implementation of main task for processing commands. * */ #include "cmd_proc_freertos_tms570.h" @@ -14,20 +14,38 @@ uint8_t* prompt; extern cmd_des_t const *cmd_list_main[]; // Main list of commands extern cmd_io_t cmd_io_std_line; // IO stack + void initCmdProc(unsigned portBASE_TYPE priority, uint8_t * introText, uint8_t * promptText) { initIoBuffer(); - prompt = (uint8_t *)pvPortMalloc(strlen((char*)promptText)); - strcpy((char *)prompt, (const char*)promptText); - xTaskCreate(processCmd, (const signed char *)"processCmd", 200, NULL, priority, processCmdHandler); - sciSend(sciREG, strlen((char *)introText), (uint8_t *)introText); - sciSend(sciREG, strlen((char *)prompt), (uint8_t *)prompt); + prompt = NULL; + if (promptText != NULL) { + prompt = (uint8_t *)pvPortMalloc(strlen((char*)promptText)); + strcpy((char *)prompt, (const char*)promptText); + } + int taskRetVal; + if ((taskRetVal = xTaskCreate(processCmd, (const signed char *)"processCmd", 200, NULL, priority, processCmdHandler)) != pdPASS) { + uint8_t taskCreateError[]="FreeRTOS: Creating task processCmd failed. Error code: "; + print(taskCreateError, strlen((char*)taskCreateError)); + char buf[20]; + i2str(buf, taskRetVal, 1, 0); + print((uint8_t *)buf, strlen(buf)); + print((uint8_t *)"\r\n", 2); + /* An error occurred, block program */ + while(1) + ; + } + if (introText != NULL) + print((uint8_t *)introText, strlen((char *)introText)); + if (prompt != NULL) + print((uint8_t *)prompt, strlen((char *)prompt)); sciReceive(sciREG, 1, NULL); } void processCmd(void *pvParameters ) { for (;;) { cmd_processor_run(&cmd_io_std_line, cmd_list_main); - printToOutputBuffer((uint8_t *)prompt, strlen((char*)prompt), portMAX_DELAY); + if (prompt != NULL) + print((uint8_t *)prompt, strlen((char*)prompt)); } } diff --git a/source/cmd_proc_run.c b/source/cmd_proc_run.c index 101237f..6edc283 100644 --- a/source/cmd_proc_run.c +++ b/source/cmd_proc_run.c @@ -42,7 +42,7 @@ int cmd_processor_run(cmd_io_t *cmd_io, cmd_des_t const **commands) } if(cmd_io->priv.ed_line.out->inbuf){ - cmd_io_putc(cmd_io,'\r'); + cmd_io_putc(cmd_io,'\r'); cmd_io_putc(cmd_io,'\n'); }else if(val<0){ char s[20]; diff --git a/source/cmdio_tisci.c b/source/cmdio_tisci.c index 6121226..2c99a07 100644 --- a/source/cmdio_tisci.c +++ b/source/cmdio_tisci.c @@ -21,93 +21,83 @@ void initIoBuffer() { inBuffer.mutex = xSemaphoreCreateMutex(); inBuffer.initialized = 1; } -portBASE_TYPE printToOutputBuffer(const uint8_t * string, uint32_t length, portTickType ticks) { - return print(&outBuffer, string, length, ticks); +portBASE_TYPE print(const uint8_t * string, uint32_t length) { + return genericPrint(&outBuffer, string, length); } -portBASE_TYPE printToInputBuffer(const uint8_t * string, uint32_t length, portTickType ticks) { - return print(&inBuffer, string, length, ticks); +portBASE_TYPE read(uint8_t * ch) { + return genericRead(&inBuffer, ch); } -portBASE_TYPE readFromOutputBuffer(uint8_t * ch, portTickType ticks) { - return read(&outBuffer, ch, ticks); -} -portBASE_TYPE readFromInputBuffer(uint8_t * ch, portTickType ticks) { - return read(&inBuffer, ch, ticks); -} -portBASE_TYPE read(tBuffer* buffer, uint8_t * ch, portTickType ticks) { +portBASE_TYPE genericRead(tBuffer* buffer, uint8_t * ch) { + if (!buffer->initialized) return errBUFFER_NOT_INITIALIZED; portBASE_TYPE ret; - ret = xQueueReceive(buffer->buf, ch, ticks); + ret = xQueueReceive(buffer->buf, ch, portMAX_DELAY); return ret; } -portBASE_TYPE print(tBuffer* buffer, const uint8_t * string, uint32_t length, portTickType ticks) { +portBASE_TYPE genericPrint(tBuffer* buffer, const uint8_t * string, uint32_t length) { + if (!buffer->initialized) return errBUFFER_NOT_INITIALIZED; uint32_t i = 0; portBASE_TYPE ret = pdPASS; + xSemaphoreTake(buffer->mutex, portMAX_DELAY); while (i < length && string[i] != '\0') { - ret = xQueueSend(buffer->buf, (void*)&string[i++], ticks); + if (xQueueSend(buffer->buf, (void*)&string[i], 0) == pdPASS) { + i++; + } + else sciSend(sciREG, 1, NULL); } - + sciSend(sciREG, 1, NULL); + xSemaphoreGive(buffer->mutex); return ret; } -void clearInputBuffer() { - clearBuffer(&inBuffer); +portBASE_TYPE clearInputBuffer() { + return clearBuffer(&inBuffer); } -void clearOutputBuffer() { - clearBuffer(&outBuffer); +portBASE_TYPE clearOutputBuffer() { + return clearBuffer(&outBuffer); } -void clearBuffer(tBuffer * buffer) { +portBASE_TYPE clearBuffer(tBuffer * buffer) { + if (!buffer->initialized) return errBUFFER_NOT_INITIALIZED; while ((xQueueReceive(buffer->buf, NULL, 0)) != errQUEUE_EMPTY) // Delete content of queue ; + return pdPASS; } -int buf_putc(cmd_io_t *cmd_io, int ch) { +int tisci_putc(cmd_io_t *cmd_io, int ch) { uint8_t c = (uint8_t)ch; - xSemaphoreTake(outBuffer.mutex, portMAX_DELAY); - if (print(&outBuffer, (uint8_t *)&c, 1, portMAX_DELAY) != pdPASS) { - xSemaphoreGive(outBuffer.mutex); + if (print((uint8_t *)&c, 1) != pdPASS) { return 0; } - xSemaphoreGive(outBuffer.mutex); return 1; } -int buf_getc(cmd_io_t *cmd_io) { +int tisci_getc(cmd_io_t *cmd_io) { uint8_t ret = '\0'; - xSemaphoreTake(inBuffer.mutex, portMAX_DELAY); - if (xQueueReceive(inBuffer.buf, &ret, portMAX_DELAY) != pdPASS) { + if (read(&ret) != pdPASS) { ret = '\0'; } - xSemaphoreGive(inBuffer.mutex); return ret; } -int buf_write(cmd_io_t *cmd_io, const void *buf, int count) { +int tisci_write(cmd_io_t *cmd_io, const void *buf, int count) { const char *tmpBuf = buf; - int i = 0; - xSemaphoreTake(outBuffer.mutex, portMAX_DELAY); - while (i < count) { - print(&outBuffer, (uint8_t *)&tmpBuf[i], 1, portMAX_DELAY); - i++; - } - xSemaphoreGive(outBuffer.mutex); - return i; + if (print((uint8_t *)tmpBuf, count) != pdPASS) + return 0; + return count; } -int buf_read(cmd_io_t *cmd_io, void *buf, int count) { +int tisci_read(cmd_io_t *cmd_io, void *buf, int count) { char *tmpBuf = buf; int i = 0; - xSemaphoreTake(inBuffer.mutex, portMAX_DELAY); - while (i < count) { - if (xQueueReceive(inBuffer.buf, &tmpBuf[i], 0) != pdPASS) + if (read((uint8_t *)&tmpBuf[i]) != pdPASS) break; i++; } - xSemaphoreGive(inBuffer.mutex); return i; } /* Setting io stack for cmdProc */ cmd_io_t cmd_io_buf={ - buf_putc, - buf_getc, - buf_write, - buf_read + tisci_putc, + tisci_getc, + tisci_write, + tisci_read }; diff --git a/source/commands.c b/source/commands.c index cb476e7..5736fd5 100644 --- a/source/commands.c +++ b/source/commands.c @@ -28,19 +28,19 @@ int cmd_do_testopchar(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[] if(opchar<0) return opchar; char str[] = {"\r\ncmd_do_testopchar called\r\nparam[0]="}; - printToOutputBuffer((uint8_t *)str, strlen(str), portMAX_DELAY); - printToOutputBuffer((uint8_t *)param[0], strlen(param[0]), portMAX_DELAY); - printToOutputBuffer((uint8_t *)"\r\nparam[1]=", 11, portMAX_DELAY); - printToOutputBuffer((uint8_t *)param[1], strlen(param[1]), portMAX_DELAY); - printToOutputBuffer((uint8_t *)"\r\nparam[2]=", 11, portMAX_DELAY); - printToOutputBuffer((uint8_t *)param[2], strlen(param[2]), portMAX_DELAY); - printToOutputBuffer((uint8_t *)"\r\nparam[3]=", 11, portMAX_DELAY); - printToOutputBuffer((uint8_t *)param[3], strlen(param[3]), portMAX_DELAY); - printToOutputBuffer((uint8_t *)"\r\nopchar=", 9, portMAX_DELAY); + print((uint8_t *)str, strlen(str)); + print((uint8_t *)param[0], strlen(param[0])); + print((uint8_t *)"\r\nparam[1]=", 11); + print((uint8_t *)param[1], strlen(param[1])); + print((uint8_t *)"\r\nparam[2]=", 11); + print((uint8_t *)param[2], strlen(param[2])); + print((uint8_t *)"\r\nparam[3]=", 11); + print((uint8_t *)param[3], strlen(param[3])); + print((uint8_t *)"\r\nopchar=", 9); char opcharBuf[4]; i2str(opcharBuf, opchar, 1, 10); - printToOutputBuffer((uint8_t *)opcharBuf, strlen(opcharBuf), portMAX_DELAY); - printToOutputBuffer((uint8_t *)"\r\n", 2, portMAX_DELAY); + print((uint8_t *)opcharBuf, strlen(opcharBuf)); + print((uint8_t *)"\r\n", 2); return 0; } @@ -49,13 +49,13 @@ int cmd_do_testparam(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) char str[] = {"cmd_do_testparam called\r\nparam[0]="}; - printToOutputBuffer((uint8_t *)str, strlen(str), portMAX_DELAY); - printToOutputBuffer((uint8_t *)param[0], strlen(param[0]), portMAX_DELAY); - printToOutputBuffer((uint8_t *)"\r\nparam[1]=", 11, portMAX_DELAY); - printToOutputBuffer((uint8_t *)param[1], strlen(param[1]), portMAX_DELAY); - printToOutputBuffer((uint8_t *)"\r\nparam[2]=", 11, portMAX_DELAY); - printToOutputBuffer((uint8_t *)param[2], strlen(param[2]), portMAX_DELAY); - printToOutputBuffer((uint8_t *)"\r\n", 2, portMAX_DELAY); + print((uint8_t *)str, strlen(str)); + print((uint8_t *)param[0], strlen(param[0])); + print((uint8_t *)"\r\nparam[1]=", 11); + print((uint8_t *)param[1], strlen(param[1])); + print((uint8_t *)"\r\nparam[2]=", 11); + print((uint8_t *)param[2], strlen(param[2])); + print((uint8_t *)"\r\n", 2); return 0; } @@ -68,7 +68,7 @@ int cmd_do_testerror(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) int cmd_do_test(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) { char str[] = {"This is the simplest command\r\n"}; - printToOutputBuffer((uint8_t *)str, strlen(str), portMAX_DELAY); + print((uint8_t *)str, strlen(str)); return 0; } diff --git a/source/notification.c b/source/notification.c index 0778f69..a737780 100644 --- a/source/notification.c +++ b/source/notification.c @@ -73,8 +73,13 @@ void memoryPort1TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, void sciNotification(sciBASE_t *sci, uint32_t flags) { +/* enter user code and remove the while loop... */ /* USER CODE BEGIN (29) */ - sciReceive(sci, 1, NULL); + if (sci == sciREG) { + if (flags & SCI_RX_INT) { + sciReceive(sci, 1, NULL); + } + } /* USER CODE END */ } diff --git a/source/sci.c b/source/sci.c index bcbbc8b..ce3d08b 100644 --- a/source/sci.c +++ b/source/sci.c @@ -11,10 +11,14 @@ /* USER CODE END */ #include "sci.h" + +/* USER CODE BEGIN (1) */ #include "cmdio_tisci.h" #include "os_queue.h" -/* USER CODE BEGIN (1) */ +extern tBuffer outBuffer; +extern tBuffer inBuffer; +static uint32_t receiveError; /* USER CODE END */ /** @struct g_sciTransfer * @brief Interrupt mode globals @@ -27,11 +31,6 @@ struct g_sciTransfer uint8_t *data; } g_sciTransfer[2]; -extern tBuffer outBuffer; -extern tBuffer inBuffer; -static uint32_t receiveError; -static uint32_t sendError; - /** @fn void sciInit(void) * @brief Initializes the SCI Driver @@ -234,25 +233,47 @@ void sciSend(sciBASE_t *sci, uint32_t length, uint8_t *data) int index = sci == sciREG ? 0 : 1; /* USER CODE BEGIN (11) */ + /* Using interrupt, does not work. Sometimes a character is lost */ +// if ((g_sciTransfer[index].mode & SCI_TX_INT) != 0) +// { + /* start transmit by sending first byte */ +// uint8_t byte = 0; +// if (xQueueReceiveFromISR(outBuffer.buf, (uint8_t *)&byte, NULL) == pdPASS) { +// sci->TD = byte; +// sci->SETINT = SCI_TX_INT; +// } +// } +// else +// { + /* send the data */// +// while (length-- > 0) +// { +// while ((sci->FLR & SCI_TX_INT) == 0) { /* wait */ }; +// sci->TD = *data++; +// } +// } /* USER CODE END */ if ((g_sciTransfer[index].mode & SCI_TX_INT) != 0) { - /* start transmit by sending first byte */ - uint8_t byte; - if (xQueueReceiveFromISR(outBuffer.buf, (uint8_t *)&byte, NULL) == pdPASS) { - sci->TD = byte; - sci->SETINT = SCI_TX_INT; - } - else sendError++; + /* we are in interrupt mode */ + + g_sciTransfer[index].length = length; + g_sciTransfer[index].data = data; + + /* start transmit by sending first byte */ + sci->TD = *g_sciTransfer[index].data++; + sci->SETINT = SCI_TX_INT; } else { /* send the data */ - while (length-- > 0) + while (xQueueIsQueueEmptyFromISR(outBuffer.buf) != pdTRUE) { while ((sci->FLR & SCI_TX_INT) == 0) { /* wait */ }; - sci->TD = *data++; + uint8_t byte; + xQueueReceiveFromISR(outBuffer.buf, (void *)&byte, NULL); + sci->TD = byte; } } @@ -340,13 +361,32 @@ int sciReceiveByte(sciBASE_t *sci) void sciReceive(sciBASE_t *sci, uint32_t length, uint8_t *data) { /* USER CODE BEGIN (16) */ + if (sci->SETINT & SCI_RX_INT) + { + /* clear error flags */ + sci->FLR = SCI_FE_INT | SCI_OE_INT | SCI_PE_INT; + + } + else + { + while (length-- > 0) + { + while ((sci->FLR & SCI_RX_INT) == 0) { /* wait */ }; + *data++ = sci->RD; + } + } /* USER CODE END */ if (sci->SETINT & SCI_RX_INT) { + /* we are in interrupt mode */ + int index = sci == sciREG ? 0 : 1; + /* clear error flags */ sci->FLR = SCI_FE_INT | SCI_OE_INT | SCI_PE_INT; + g_sciTransfer[index].length = length; + g_sciTransfer[index].data = data; } else { @@ -465,8 +505,6 @@ void sciHighLevelInterrupt(void) uint32_t vec = sciREG->INTVECT0; /* USER CODE BEGIN (26) */ -/* USER CODE END */ - switch (vec) { case 1: @@ -487,7 +525,7 @@ void sciHighLevelInterrupt(void) case 11: /* receive */ - { uint32_t byte = sciREG->RD; + { uint8_t byte = sciREG->RD; if (xQueueSendFromISR(inBuffer.buf, (void*)&byte, NULL) == errQUEUE_FULL) receiveError++; sciNotification(sciREG, SCI_RX_INT); @@ -496,23 +534,38 @@ void sciHighLevelInterrupt(void) case 12: /* transmit */ - { - uint8_t byte; - if (xQueueReceiveFromISR(outBuffer.buf, (uint8_t *)&byte, NULL) == pdPASS) { - sciREG->TD = byte; - sciNotification(sciREG, SCI_TX_INT); - } - else { - sciREG->CLRINT = SCI_TX_INT; - } - break; - } + /* using interrupt, does not work properly, sometimes a character is lost */ + /* if (xQueueIsQueueEmptyFromISR(outBuffer.buf) == pdTRUE) { + sciREG->CLRINT = SCI_TX_INT; + sciNotification(sciREG, SCI_TX_INT); + } + else { + uint8_t byte = 0; + xQueueReceiveFromISR(outBuffer.buf, (uint8_t *)&byte, NULL); + while (sciIsTxReady(sciREG) == 0) + ; + sciREG->TD = byte; + } + */ + /* transmit */ + if (--g_sciTransfer[0].length > 0) + { + sciREG->TD = *g_sciTransfer[0].data++; + } + else + { + sciREG->CLRINT = SCI_TX_INT; + sciNotification(sciREG, SCI_TX_INT); + } + break; - default: + default: /* phantom interrupt, clear flags and return */ sciREG->FLR = ~sciREG->SETINTLVL & 0x07000303; break; } +/* USER CODE END */ + /* USER CODE BEGIN (27) */ /* USER CODE END */ } @@ -525,7 +578,6 @@ void sciHighLevelInterrupt(void) void sciLowLevelInterrupt(void) { uint32_t vec = sciREG->INTVECT1; - /* USER CODE BEGIN (28) */ /* USER CODE END */ @@ -550,24 +602,30 @@ void sciLowLevelInterrupt(void) case 11: /* receive */ { uint32_t byte = sciREG->RD; - if (xQueueSendFromISR(inBuffer.buf, (void *)&byte, NULL) == errQUEUE_FULL) - receiveError++; - sciNotification(sciREG, SCI_RX_INT); + + if (g_sciTransfer[0].length > 0) + { + *g_sciTransfer[0].data++ = byte; + g_sciTransfer[0].length--; + if (g_sciTransfer[0].length == 0) + { + sciNotification(sciREG, SCI_RX_INT); + } + } } break; case 12: /* transmit */ - { - uint8_t byte; - if (xQueueReceiveFromISR(outBuffer.buf, (uint8_t *)&byte, NULL) == pdPASS) { - sciREG->TD = byte; - sciNotification(sciREG, SCI_TX_INT); - } - else { - sciREG->CLRINT = SCI_TX_INT; - } - } + if (--g_sciTransfer[0].length > 0) + { + sciREG->TD = *g_sciTransfer[0].data++; + } + else + { + sciREG->CLRINT = SCI_TX_INT; + sciNotification(sciREG, SCI_TX_INT); + } break; default: diff --git a/source/sys_main.c b/source/sys_main.c index cb35d7a..9dd707d 100644 --- a/source/sys_main.c +++ b/source/sys_main.c @@ -38,11 +38,11 @@ void main(void) - { +{ /* USER CODE BEGIN (3) */ sciInit(); - initCmdProc(1, (uint8_t*)"\r\nType commands\r\n", (uint8_t *)"--> "); _enable_IRQ(); + initCmdProc(1, (uint8_t*)"\r\nType commands\r\n", (uint8_t *)"--> "); vTaskStartScheduler(); //We should never get here