Friday, December 25, 2015

Phase 2: Complete

Finally!!!
Took long enough

Lets see ... the bug fixes I made were all related to either solving a race condition where in (calls to uartio_tx_flush while DMA channel 0 has the mutex to the first swinging buffer half ... has the potential to configure DMA channel 1 for the second swinging buffer half - corrupting the tx output and handshaking operation in uartio_dma_isr() that clears the DmaMutex)

Took some time to see and correct that. Honestly all this could have been avoided if I stuck with the backup plan of not using DMA to offload uart tx and instead using the systick handler and polled I/O

But I have no regrets because ultimately I want to be able to dump data and debug messages as fast  as possible without burdening the main processor and DMA is always the way to go.  Having the entire process interrupt driven is added icing on the cake.

The only other issue was formatting the output of various monitor_assist_() routines. The results from minicom are shown below.

Another issue I tackled and may have to revisit is the problems I often have loading code with openocd/arm-none-eabi-gdb. I chose conservative values for CCLK/adapter_khz keeping in mind that although I initialize the lpc1788 to run off the external 24Mhz clock through the PLL to generate a 120Mhz cpu clock, it powers up with the 12Mhz RC clock enabled ... and that should be what openocd parameters should be set to.

CCLK should be 12000
adapter_khz should be 1/6th of that or less ... 500 to 2000

..ie........
..ieieie....
..ie........
..ieieie....
..ie........    Igbo Embedded
..ieieie....    EGWU v1,1 (c) 2015
..ie........    Samuel Igwe


egwu-> mdw 0x10000000 0x30
10000000:       10010000  10001E0D  10000D91  10000D91  10000D91  10000D91  10000D91  10000D91  
10000020:       10000D91  10000D91  10000D91  10000D91  10000D91  10000D91  10000D91  10000D29  
10000040:       10000D9D  10000D9D  10000D9D  10000D9D  10000D9D  10000D9D  10000D9D  10000D9D  
10000060:       10000D9D  10000D9D  10000D9D  10000D9D  10000D9D  10000D9D  10000D9D  10000D9D  
10000080:       10000D9D  10000D9D  10000D9D  10000D9D  10000D9D  10000D9D  10000D9D  10000D9D  
100000A0:

egwu-> mdw 0x10000000 
10000000:       10010000  

egwu-> mdh 0x10000000 0x30
10000000:       0000  1001  1E0D  1000  0D91  1000  0D91  1000  
10000010:       0D91  1000  0D91  1000  0D91  1000  0D91  1000  
10000020:       0D91  1000  0D91  1000  0D91  1000  0D91  1000  
10000030:       0D91  1000  0D91  1000  0D91  1000  0D29  1000  
10000040:       0D9D  1000  0D9D  1000  0D9D  1000  0D9D  1000  
10000050:

egwu-> mdh 0x10000000 
10000000:       0000  

egwu-> mdb 0x10000000 0x30
10000000:       00  00  01  10  0D  1E  00  10  
10000008:       91  0D  00  10  91  0D  00  10  
10000010:       91  0D  00  10  91  0D  00  10  
10000018:       91  0D  00  10  91  0D  00  10  
10000020:       91  0D  00  10  91  0D  00  10  
10000028:

egwu-> mdb 0x10000000
10000000:       00  

egwu-> mww 0x20000000 0xc0defeed
C0DEFEED
egwu-> mww 0x20000000 0xa5015a02
A5015A02
egwu-> mdw 0x20000000 4
20000000:       A5015A02  BEB2400C  22916148  0010C3C9  

egwu-> mww 0x2000004 0xc0defeed
..ie........
..ieieie....
..ie........
..ieieie....
..ie........    Igbo Embedded
..ieieie....    EGWU v1,1 (c) 2015
..ie........    Samuel Igwe


egwu-> mww 0x20000004 0xc0defeed
C0DEFEED
egwu-> mdw 0x20000000 4
20000000:       A5015A02  C0DEFEED  22916148  0010C3C9 



No comments:

Post a Comment