tag:blogger.com,1999:blog-61381803795828695342024-03-18T21:28:52.370-07:00Mark's SpaceEnjoy lifeAnonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.comBlogger121125tag:blogger.com,1999:blog-6138180379582869534.post-68364950261539369382017-09-06T20:03:00.004-07:002017-09-06T20:03:40.336-07:00Jlink Python Programming GUI Tool<br />
1 Introduction<br />
<br />
We use Python+Pyside make a GUI programming tool. By calling JLinkARM.Dll, it can access the device via C2 and SWD interface. The EFM8 and EFM32 which are C8051 and ARM cortex M0/M3/M4 core are in the latest Segger JLinkARM.dll support list. It can download hex file, and also binary file with offset setting.<br />
<br />
<br />
https://markding.github.io/pyprogrammer/Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com2tag:blogger.com,1999:blog-6138180379582869534.post-59271952143733886152015-12-25T00:03:00.001-08:002015-12-25T00:03:47.310-08:00Manchester and Biphase Mark Code Encoder/Decoder Implementation<h1 style="box-sizing: border-box; color: #159957; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: normal; margin: 0px 0px 1rem;">
Implementing Manchester and BMC encoder/decoder on EFM8LB1</h1>
<h2 style="box-sizing: border-box; color: #159957; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: normal; margin-bottom: 1rem; margin-top: 2rem;">
<a aria-hidden="true" class="anchor" href="http://markding.github.io/Manchester-BMC/#1-introduction" id="1-introduction" style="box-sizing: border-box; color: #1e6bb8; margin-top: 0px; text-decoration: none;"><span class="octicon octicon-link" style="box-sizing: border-box; margin-top: 0px;"></span></a>1. Introduction</h2>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
The Manchester code and Biphase Mark Code(BMC) are popular line code which conveys the data and clock information. Here will introduce how to implement Manchester and BMC encoder/decoder on Silicon Labs EFM8LB1 with its Configurable Logic Units(CLU).</div>
<h2 style="box-sizing: border-box; color: #159957; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: normal; margin-bottom: 1rem; margin-top: 2rem;">
<a aria-hidden="true" class="anchor" href="http://markding.github.io/Manchester-BMC/#2-manchester-code" id="2-manchester-code" style="box-sizing: border-box; color: #1e6bb8; margin-top: 0px; text-decoration: none;"><span class="octicon octicon-link" style="box-sizing: border-box; margin-top: 0px;"></span></a>2. Manchester code</h2>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
Manchester Code is widely used(e.G., In 10BASE-T Ethernet(IEEE802.3)). The encoding of each bit is either low then high, or high then low, of equal time. For IEEE802.3 standard, "1" is represented by a rising edge. "0" is represented by a failing edge. It has no DC component, and is self-clocking.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="MC Bit" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/mc-bit.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 1 Manchester Bit Data (IEEE802.3)</strong></div>
<h3 style="box-sizing: border-box; color: #159957; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: normal; margin-bottom: 1rem; margin-top: 2rem;">
<a aria-hidden="true" class="anchor" href="http://markding.github.io/Manchester-BMC/#21-manchester-encoder" id="21-manchester-encoder" style="box-sizing: border-box; color: #1e6bb8; margin-top: 0px; text-decoration: none;"><span class="octicon octicon-link" style="box-sizing: border-box; margin-top: 0px;"></span></a>2.1. Manchester Encoder</h3>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
It is easy to generate Manchester encoded data by XOR SPI MOSI and SCK signals. The SCK phase and polarity setting (CKPOL = 0, CKPHA = 1). the EFM8LB1 CLU setting to implement Manchester Encoder as follows.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="MC Encoder" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/Manchester-encoder-CLU.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 2 Manchester Encoder</strong></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
The CLU configuration code as follows:</div>
<div class="highlight highlight-source-c" style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1rem;">
<pre style="background-color: #f3f6fa; border-radius: 0.3rem; border: 1px solid rgb(220, 230, 240); box-sizing: border-box; color: #567482; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 0.9rem; font-stretch: normal; line-height: 1.45; overflow: auto; padding: 0.8rem; word-break: normal; word-wrap: normal;">SFRPAGE = 0x20;
<span class="pl-c" style="box-sizing: border-box; color: #969896; margin-top: 0px;">/* MXA as P0.4, MXB as P0.7*/</span>
CLU0MX = 0xAB;
CLU0FN = LUT_XOR(SI_LUT_A, SI_LUT_B);
CLU0CF = CLU0CF_OEN__ENABLE | CLU0CF_OUTSEL__LUT;
CLEN0 |= CLEN0_C0EN__ENABLE;
SFRPAGE = <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">0</span>;</pre>
</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
The Manchester Encoder waveform is shown as follows:</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="MC Encoder Waveform" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/mc-en-waveform.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 3 Manchester Encoder Waveform</strong></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
From the waveform, when MOSI = 0, the XORed output follows SCK, it is failing edge = '0'; When MOSI = 1, the XORed output is an inverted SCK, it is rising edge = '1'.</div>
<h3 style="box-sizing: border-box; color: #159957; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: normal; margin-bottom: 1rem; margin-top: 2rem;">
<a aria-hidden="true" class="anchor" href="http://markding.github.io/Manchester-BMC/#22-manchester-decoder" id="22-manchester-decoder" style="box-sizing: border-box; color: #1e6bb8; margin-top: 0px; text-decoration: none;"><span class="octicon octicon-link" style="box-sizing: border-box; margin-top: 0px;"></span></a>2.2. Manchester Decoder</h3>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
The Manchester bit value is presented in the second half of each bit time. Here we can generate a clock to capture the value at second half of bit time. The transition in middle of each bit triggers timer with 3/8 bit time. Generating SCK rising edge when timer overflow. Generating SCK failing edge when timer overflow again and stop the timer. Repeat above steps for rest bits.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="MC Decoder Clock" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/mc-de-clk.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 4 Manchester Decoder Clock Generation</strong></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
How to trigger the Timer at Manchester middle transition? First, Generating latch data by capturing the data at 6/8 bit time. Second, Manchester data XOR latch data to get rising edge at middle transition. The XOR result at 6/8 bit must be ‘0’, because latch data captures same MC data. And then at middle transition, the XOR result change to ‘1” and generate rising edge. Now we got the rising edge of middle transition, this is can be used to trigger Timer with D flip-flop to start with 3/8 bit time.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="MC Decoder Clock Trigger" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/mc-de-trigger.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 5 Manchester Decoder Clock Trigger Signal Generator</strong></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
How to control Timer? The MC XOR LDAT rising edge start timer. Timer stops after 6/8 bit time. From the observation on the timing diagram, we can get Boolean Equation is F = A NOR B. Where the A represents MC XOR LDAT, B represents SCK. The F represents TMR2 Force reload signal.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="MC Decoder Timer Control" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/mc-de-tmr-ctrl.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 6 Manchester Decoder Timer Control</strong></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
This is implementation of Manchester Decoder. It uses four CLUs. The CLU2 uses internal D flip-flop, MC as D input, output is Latch MC, Clock source is carry from CLU1. The CLU1 uses internal D flip-flop too, it generates clock signal, the D flip-flop clock source comes from Timer 2 overflow signal. CLU3 buffer MC data and output as carry signal of CLU0. the CLU0 combine three inputs MC, Latched MC and Clock to generate Timer2 force reload signal.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="MC Decoder Implementation" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/Manchester-decoder-CLU.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 7 Manchester Decoder Implementation</strong></div>
<div class="highlight highlight-source-c" style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1rem;">
<pre style="background-color: #f3f6fa; border-radius: 0.3rem; border: 1px solid rgb(220, 230, 240); box-sizing: border-box; color: #567482; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 0.9rem; font-stretch: normal; line-height: 1.45; overflow: auto; padding: 0.8rem; word-break: normal; word-wrap: normal;">CLU0MX = CLU0MX_MXA__CLU0A1 | CLU0MX_MXB__CLU0B2;
CLU0CF = CLU0CF_OUTSEL__LUT | CLU0CF_OEN__ENABLE;
CLU0FN = LUT_NOR(SI_LUT_A, LUT_XOR(SI_LUT_B, SI_LUT_C));
CLU1MX = CLU1MX_MXA__CLU1A1 | CLU1MX_MXB__CLU1B1;
CLU1CF = CLU1CF_OEN__ENABLE | CLU1CF_CLKSEL__ALTCLK;
CLU1FN = LUT_NOT(SI_LUT_A);
CLU2MX = CLU2MX_MXA__CLU2A0 | CLU2MX_MXB__CLU2B8;
CLU2CF = CLU2CF_CLKSEL__CARRY_IN | CLU2CF_OEN__ENABLE;
CLU2FN = SI_LUT_B;
CLU3MX = 0x00;
CLU3CF = CLU3CF_OUTSEL__LUT | CLU3CF_OEN__ENABLE;
CLU3FN = SI_LUT_C;
CLEN0 = 0x0F; <span class="pl-c" style="box-sizing: border-box; color: #969896; margin-top: 0px;">// enable CLU0, CLU1, CLU2, CLU3</span></pre>
</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
The overall view on all related signals of Manchester Decoder as follows.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="MC Decoder Waveform" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/mc-de-waveform.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 8 Manchester Decoder Waveform</strong></div>
<h2 style="box-sizing: border-box; color: #159957; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: normal; margin-bottom: 1rem; margin-top: 2rem;">
<a aria-hidden="true" class="anchor" href="http://markding.github.io/Manchester-BMC/#3-biphase-mark-code" id="3-biphase-mark-code" style="box-sizing: border-box; color: #1e6bb8; margin-top: 0px; text-decoration: none;"><span class="octicon octicon-link" style="box-sizing: border-box; margin-top: 0px;"></span></a>3. Biphase Mark Code</h2>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
Biphase Mark Code(BMC) uses the presence or absence of transitions to indicate logical value. BMC transitions on every positive edge of the clock signal BMC transitions on negative edge of the clock signal when the data is a 1.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="BMC Data" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/bmc-data.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 9 BMC Data</strong></div>
<h3 style="box-sizing: border-box; color: #159957; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: normal; margin-bottom: 1rem; margin-top: 2rem;">
<a aria-hidden="true" class="anchor" href="http://markding.github.io/Manchester-BMC/#31-bmc-encoder" id="31-bmc-encoder" style="box-sizing: border-box; color: #1e6bb8; margin-top: 0px; text-decoration: none;"><span class="octicon octicon-link" style="box-sizing: border-box; margin-top: 0px;"></span></a>3.1. BMC Encoder</h3>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
To encode the BMC data, first at all, generating transition for data 1. Here we choose a way to XOR Data and Q1, where Q1 is the D flip-flop output, and Q1 XOR Data as the input of D flip-flop. When data is 1, at first half bit time, the Q1 ^ Data = Not Q1. At the failing edge of clock, the Q1 captures the Not Q1, which generate a transition at middle bit time. When the data is 0, the Q1 keeps unchanged, no transition happens.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="BMC Encoder Transition Data 1" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/bmc-circuit4transition-data1.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 10 BMC Encoder Transitions on Data 1</strong></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
And the waveform of transitions on data 1 is shown as follows:</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="BMC Encoder Waveform of Transition Data 1" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/bmc-en-waveform-transition-data1.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 10 BMC Encoder Waveform of Transitions on Data 1</strong></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
From the timing diagram, we can see the D flip-flop captures the Q1 XOR Data at failing edge of clock. For data = 1, there is a transition at the time, for data = 0, there is not transition at the time. And also we notice that Q1 keeps unchanged at the beginning of each bit, the D flip-flop maintains the Q value before the rising edge of the clock.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
The second step, we need to generate transition at beginning of each bit. The idea here is that we flip first bit, and keeps second bit unchanged, and then flip third bit, and keep fourth bit unchanged, etc. So we use Q2 which is the clock by 2 and XOR the Q1 to generate BMC data. When Q2 is 1, the Q1 ^ 1 = Not Q1, it makes transition. When Q2 is 0, the Q1 ^ 0 = Q1, it changes nothing. And finally, we get BMC data with transitions at beginning of every bit. And also transition at middle bit when data is 1.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="BMC Encoder Transition of Every Bit" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/bmc-en-transition-everybit.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 11 BMC Encoder Transitions at Beginning of Every Bit</strong></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
Here is the implementation of the BMC Encoder. It uses four CLUs. For CLU0, it generates Q2 which is the clock divided by 2. For CLU1 and CLU3, they generate Q1 which contains transition at middle bit time when data is 1. The CLU2 XOR the Q1 and Q2, output the BMC encoding data.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="BMC Encoder Implementation" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/BMC-encoder-CLU.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 12 BMC Encoder Implementation</strong></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
Here are all signals waveform we talked previously.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="BMC Encoder Waveform" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/bmc-en-waveform.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 13 BMC Encoder Waveform</strong></div>
<h3 style="box-sizing: border-box; color: #159957; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: normal; margin-bottom: 1rem; margin-top: 2rem;">
<a aria-hidden="true" class="anchor" href="http://markding.github.io/Manchester-BMC/#32-bmc-decoder" id="32-bmc-decoder" style="box-sizing: border-box; color: #1e6bb8; margin-top: 0px; text-decoration: none;"><span class="octicon octicon-link" style="box-sizing: border-box; margin-top: 0px;"></span></a>3.2. BMC Decoder</h3>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
The BMC decoder needs more logical circuitry, base one the resource we have in one EFM8LB1 device, here we made a solution to decode the BMC data with minimums hardware resources we can. As we talked in previous slides. The BMC transition at beginning of each bit or middle or bit when data = 1. Here is the timing diagram of BMC, From the observation, we capture the data at 6/8 bit time. When the value between first sample point and second sample point is same, that means second bit is “1”. That is because the transition happens twice at bit boundary and middle of second bit. When the value between first sample point and second sample is difference, that means second b it is “0”. That is because the transition happens once, at bit boundary. Base on above analysis. We can use XNOR two sample points value to generate data which apart from 6/8 bit time compare with BMC data. And using a timer to generate SCK which rising edge at beginning of each bit.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="BMC Decoder Method" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/bmc-de-method.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 14 BMC Decoder Method</strong></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
The Timer control is very important in BMC decoder design. The Timers are used to capture the data and generate clock. Here is the requirement on Timer setting, Timer starts from beginning of each bit, and Timer stops at 6/8 bit time. To achieve the functionality, we choose two signals to control Timer: Timer OVF signal, and BMC XNOR prior BMC 6/8 bit value. The Time OVF is low at beginning of the bit since it is stop. It can be used to start timer when BMC XNOR PBMC change to 0 at beginning of each bit. The XNOR result start from 6/8 bit time must be “1”, since it is same value after capturing data at that point. It can be use to stop timer.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="BMC Decoder Timer Control" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/bmc-de-tmr-ctrl.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 15 BMC Decoder Timer Control</strong></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
Here is the timing diagram on clock and data generation. BMC data XNOR prior BMC value at 6/8 bit time to generate Data. And the Timer force reload signal can be inversed as clock. The SCK second edge to capture the data which is beginning of each bit of BMC data.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="BMC Decoder Data and Clock Generation" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/bmc-de-data-clock-generation.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 16 BMC Decoder Data and Clock Generation</strong></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
Here is the CLU implementation for BMC decoder. The CLU0 act as a selector, the Boolean expression is BC + B’A. It selects T2OVF or Carry In which is XNOR result of BMC and PBMC, the T2OVF is one clock after T4OVF, which make sure when T2OVF is high, the selector captures the value from Carry in is high. That is because after 6/8 bit time, the XNOR result must be high, which stops the Timers. the CLU0 output is Timer Reload force. The CLU1 invert CLU0 output as Clock output. The CLU2 and CLU3 are combined together to generate Data. When T4OVF happens, it generates on system clock width pulse. At rising edge, the CLU3 captures the XNOR result and output as Data; at failing edge, the CLU2 captures 6/8 bit time BMC value. And the XNOR result as carry in signal to CLU0 to control the Timer start-stop.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="BMC Decoder Implementation" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/BMC-decoder-CLU.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 17 BMC Decoder Implementation</strong></div>
<div class="highlight highlight-source-c" style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1rem;">
<pre style="background-color: #f3f6fa; border-radius: 0.3rem; border: 1px solid rgb(220, 230, 240); box-sizing: border-box; color: #567482; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 0.9rem; font-stretch: normal; line-height: 1.45; overflow: auto; padding: 0.8rem; word-break: normal; word-wrap: normal;">CLU0MX = 0x40; <span class="pl-c" style="box-sizing: border-box; color: #969896; margin-top: 0px;">// MXA as T2OVF, MXB as CLU0 output</span>
CLU0CF = CLU0CF_OUTSEL__LUT;
CLU0FN = LUT_OR(LUT_AND(SI_LUT_B, SI_LUT_C),
<span class="pl-en" style="box-sizing: border-box; color: #795da3;">LUT_AND</span>(LUT_NOT(SI_LUT_B), SI_LUT_A));
CLU1MX = 0x00; <span class="pl-c" style="box-sizing: border-box; color: #969896;">// MXA as CLU0 output</span>
CLU1CF = CLU1CF_OEN__ENABLE | CLU1CF_OUTSEL__LUT;
CLU1FN = LUT_NOT(SI_LUT_A);
CLU2MX = 0x48; <span class="pl-c" style="box-sizing: border-box; color: #969896;">// MXA as T4OVF, MXB as P0.2</span>
CLU2CF = CLU2CF_CLKINV__INVERT | CLU2CF_CLKSEL__MXA_INPUT;
CLU2FN = SI_LUT_B;
CLU3MX = 0x22; <span class="pl-c" style="box-sizing: border-box; color: #969896;">// MXA as CLU2 output;</span>
CLU3CF = CLU3CF_OEN__ENABLE | CLU3CF_CLKSEL__ALTCLK;
CLU3FN = LUT_XNOR(SI_LUT_A, SI_LUT_C);
CLEN0 = 0x0F; <span class="pl-c" style="box-sizing: border-box; color: #969896;">// enable CLU0, CLU1, CLU2, CLU3</span></pre>
</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
Here are the BMC data, SPI SCK, MOSI signals waveform. We can see the data start from 6/8 bit time compare with BMC data. The MOSI data is valid on second edge of SCK period (PHA=1).</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<img alt="BMC Decoder Waveform" src="https://raw.github.com/MarkDing/Manchester-BMC/master/images/bmc-de-waveform.png" style="border: 0px; box-sizing: border-box; margin-top: 0px; max-width: 100%;" /></div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
<strong style="box-sizing: border-box; margin-top: 0px;">Figure 18 BMC Decoder Waveform</strong></div>
<h2 style="box-sizing: border-box; color: #159957; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: normal; margin-bottom: 1rem; margin-top: 2rem;">
<a aria-hidden="true" class="anchor" href="http://markding.github.io/Manchester-BMC/#4-license" id="4-license" style="box-sizing: border-box; color: #1e6bb8; margin-top: 0px; text-decoration: none;"><span class="octicon octicon-link" style="box-sizing: border-box; margin-top: 0px;"></span></a>4. LICENSE</h2>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
The MIT License (MIT)</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
Copyright (c) 2015 Mark Ding(<a href="mailto:mark.ding@hotmail.com" style="box-sizing: border-box; color: #1e6bb8; margin-top: 0px; text-decoration: none;">mark.ding@hotmail.com</a>)</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</div>
<div style="box-sizing: border-box; color: #606c71; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17.6px; line-height: 26.4px; margin-bottom: 1em;">
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</div>
<html>
<head>
<title>Redirecting</title>
</head>
</html>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-31511792806968698452015-04-07T19:34:00.001-07:002015-04-07T19:34:47.404-07:00Using pyvisa to control instrument via GPIB<h2 id="introduction" style="background: url(http://markding.github.io/images/bg_hr.png) 50% 100% repeat-x rgb(242, 242, 242); border: 0px; color: #222222; font-family: 'Lucida Grande', Calibri, Helvetica, Arial, sans-serif; font-size: 32px; font-stretch: inherit; letter-spacing: -1px; line-height: inherit; margin: 10px 0px; padding: 0px 0px 10px; vertical-align: baseline;">
1. Introduction</h2>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
We have met several issues which related with power on/off operation. The failure rate is extremely low which is not efficiency for manual operation. So we would like to setup an automatic testing environment. The GPIB(General Purpose Interface Bus) is the way to control the instrument. This article shows how to control the Agilent E3631A (Triple Output DC Power Supply).</div>
<h2 id="gpib-interface" style="background: url(http://markding.github.io/images/bg_hr.png) 50% 100% repeat-x rgb(242, 242, 242); border: 0px; color: #222222; font-family: 'Lucida Grande', Calibri, Helvetica, Arial, sans-serif; font-size: 32px; font-stretch: inherit; letter-spacing: -1px; line-height: inherit; margin: 10px 0px; padding: 0px 0px 10px; vertical-align: baseline;">
2. GPIB Interface</h2>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
Here is the Agilent 82357A USB/GPIB Interface in our hand. Following link shows the detailed information.<br />http://www.keysight.com/en/pd-1000004416%3Aepsg%3Apro-pn-82357A/usb-gpib-interface?cc=US&lc=eng</div>
<h2 id="pyvisa-installation" style="background: url(http://markding.github.io/images/bg_hr.png) 50% 100% repeat-x rgb(242, 242, 242); border: 0px; color: #222222; font-family: 'Lucida Grande', Calibri, Helvetica, Arial, sans-serif; font-size: 32px; font-stretch: inherit; letter-spacing: -1px; line-height: inherit; margin: 10px 0px; padding: 0px 0px 10px; vertical-align: baseline;">
3. Pyvisa installation</h2>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
Pyvisa is a Python package for support of the “Virtual Instrument Software Architecture” (VISA), in order to control measurement devices and test equipment via GPIB, RS232, Ethernet or USB.<br />To install the pyvisa by using pip:<br />$ pip install pyvisa</div>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
Detailed information can be found in https://github.com/hgrecco/pyvisa</div>
<h2 id="ni-driver-installation" style="background: url(http://markding.github.io/images/bg_hr.png) 50% 100% repeat-x rgb(242, 242, 242); border: 0px; color: #222222; font-family: 'Lucida Grande', Calibri, Helvetica, Arial, sans-serif; font-size: 32px; font-stretch: inherit; letter-spacing: -1px; line-height: inherit; margin: 10px 0px; padding: 0px 0px 10px; vertical-align: baseline;">
4. NI driver installation</h2>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
Pyvisa has been tested with NI-VISA 3.2, which needs us to install its driver.<br />Download and install NIVISA541full.exe from following link http://www.ni.com/download/ni-visa-5.4.1/4626/en/</div>
<h2 id="agilent-driver-installation" style="background: url(http://markding.github.io/images/bg_hr.png) 50% 100% repeat-x rgb(242, 242, 242); border: 0px; color: #222222; font-family: 'Lucida Grande', Calibri, Helvetica, Arial, sans-serif; font-size: 32px; font-stretch: inherit; letter-spacing: -1px; line-height: inherit; margin: 10px 0px; padding: 0px 0px 10px; vertical-align: baseline;">
5. Agilent driver installation.</h2>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
The GPIB interface is Agilent product, which needs its driver installed.<br />Download and install the latest IOLibSuite_17_0_19013.exe from following link.<br />http://www.keysight.com/main/software.jspx?ckey=1184883&lc=chi&cc=CN&nid=-34027.536881832&id=1184883</div>
<h2 id="using-hp-agilent-82357a82357b-gpib-in-ni" style="background: url(http://markding.github.io/images/bg_hr.png) 50% 100% repeat-x rgb(242, 242, 242); border: 0px; color: #222222; font-family: 'Lucida Grande', Calibri, Helvetica, Arial, sans-serif; font-size: 32px; font-stretch: inherit; letter-spacing: -1px; line-height: inherit; margin: 10px 0px; padding: 0px 0px 10px; vertical-align: baseline;">
6. Using HP Agilent 82357A/82357B GPIB in NI</h2>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
http://digital.ni.com/public.nsf/allkb/F7C187DBF09EBE1186256F550065BD32<br />In order to use the NI VISA drivers and both the HP Agilent and NI GPIB devices, you will need to enable:</div>
<ul style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; list-style: inside; margin: 0px 0px 15px; padding: 0px 0px 0px 20px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">NIVISATulip.dll</li>
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">NI 488.2 from within the Agilent libraries</li>
</ul>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
Complete the steps in the following document to enable NIVISATulip.dll:<br />KnowledgeBase 20KG1C7Z: Can I Use Both National Instruments (GPIB) and Agilent/HP (HPIB) Controllers in the Same System? (http://digital.ni.com/public.nsf/websearch/3B3626D9C1F999218625694200791AD7?OpenDocument)</div>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
Complete the following steps to enable NI 488.2 from within Agilent Connection Expert 15.x and 16.x:</div>
<ul style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; list-style: inside; margin: 0px 0px 15px; padding: 0px 0px 0px 20px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Select Tools»Agilent 488 from the pulldown menu.</li>
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Select the Agilent 488 Options tab.</li>
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Check Enable Agilent GPIB cards for 488 programs.</li>
</ul>
<h2 id="agilent-e3631a-spec-download" style="background: url(http://markding.github.io/images/bg_hr.png) 50% 100% repeat-x rgb(242, 242, 242); border: 0px; color: #222222; font-family: 'Lucida Grande', Calibri, Helvetica, Arial, sans-serif; font-size: 32px; font-stretch: inherit; letter-spacing: -1px; line-height: inherit; margin: 10px 0px; padding: 0px 0px 10px; vertical-align: baseline;">
7. Agilent E3631A spec download</h2>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
Download spec from http://www.keysight.com/main/techSupport.jspx?cc=CN&lc=chi&nid=-35721.384004.08&pid=836433&pageMode=OV</div>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
Here is part of the command list:</div>
<pre style="background-color: white; border-radius: 2px; border: 0px; box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 10px; color: #222222; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 14px; font-stretch: inherit; line-height: inherit; overflow: auto; padding: 10px; vertical-align: baseline; width: 640px;"><code style="border-radius: 2px; border: 0px; box-shadow: none; display: block; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 3px; padding: 3px; vertical-align: baseline; width: 640px;">APPLy {P6V|P25V|N25V}[,{<voltage>|DEF|MIN|MAX}[,{ <current>|DEF|MIN|MAX}]]
APPLy? [{P6V|P25V|N25V}]
OUTPut
[:STATe] {OFF|ON}
[:STATe]?
:TRACk[:STATe] {OFF|ON}
:TRACk[:STATe]?
</current></voltage></code></pre>
<h2 id="pyvisa-tutorial" style="background: url(http://markding.github.io/images/bg_hr.png) 50% 100% repeat-x rgb(242, 242, 242); border: 0px; color: #222222; font-family: 'Lucida Grande', Calibri, Helvetica, Arial, sans-serif; font-size: 32px; font-stretch: inherit; letter-spacing: -1px; line-height: inherit; margin: 10px 0px; padding: 0px 0px 10px; vertical-align: baseline;">
8. Pyvisa tutorial</h2>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
From pyvisa official website, we can find the tutorial https://pyvisa.readthedocs.org/en/master/tutorial.html.</div>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
Here is the example code to control E3631A output.</div>
<pre style="background-color: white; border-radius: 2px; border: 0px; box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 10px; color: #222222; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 14px; font-stretch: inherit; line-height: inherit; overflow: auto; padding: 10px; vertical-align: baseline; width: 640px;"><code class="language-python" style="border-radius: 2px; border: 0px; box-shadow: none; display: block; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 3px; padding: 3px; vertical-align: baseline; width: 640px;">import visa
rm = visa.ResourceManager()
res = rm.list_resources()
print("Find following resources: ")
print(res)
print("Opening " + res[-1])
inst = rm.open_resource(res[-1])
# When sending command to E3631A, The "Rmt" and "Adrs" icon are on on the display
# panel. All input from panel are inactived, util you press "Store/Local" button.
inst.query("*IDN?")
inst.write("INST P6V") # Select +6V output
inst.write("VOLT 2.0") # Set output voltage to 3.0 V
inst.write("CURR 1.0") # Set output current to 1.0 A
# The APPLy command provides the most straightforward method to program the
# power supply over the remote interface.
# inst.write("APPL P6V, 3.0, 1.0")
# power on/off
inst.write("OUTP OFF")
inst.write("OUTP ON")
</code><div>
</div>
</pre>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-77372807105277431882014-12-25T18:49:00.003-08:002014-12-25T23:27:03.721-08:00efm32 an0060 encrypt aes128 support<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
In AN0060, there is a encrypt.exe which support AES256 only. But for ZG device supports AES128, we need to make a change and generate new exe file. The steps as follows:</div>
<ul style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; list-style: inside; margin: 0px 0px 15px; padding: 0px 0px 0px 20px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Download libtom source code<br />Goto https://github.com/libtom/libtomcrypt, get latest version 1.17.</li>
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Extract it and generate directory “libtomcrypt-1.17”</li>
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Run msys under windows.<br />Here we use the msys from Railsinstaller directory</li>
</ul>
<pre style="background-color: white; border-radius: 2px; border: 0px; box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 10px; color: #222222; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 14px; font-stretch: inherit; line-height: inherit; overflow: auto; padding: 10px; vertical-align: baseline; width: 640px;"><code style="border-radius: 2px; border: 0px; box-shadow: none; display: block; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 3px; padding: 3px; vertical-align: baseline; width: 640px;">$ C:\RailsInstaller\DevKit\msys.bat
</code></pre>
<ul style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; list-style: inside; margin: 0px 0px 15px; padding: 0px 0px 0px 20px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">In msys window, enter libtomcrypt-1.17, edit makefile.<br />Uncomment line 12 and 13, save and close it.</li>
</ul>
<pre style="background-color: white; border-radius: 2px; border: 0px; box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 10px; color: #222222; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 14px; font-stretch: inherit; line-height: inherit; overflow: auto; padding: 10px; vertical-align: baseline; width: 640px;"><code style="border-radius: 2px; border: 0px; box-shadow: none; display: block; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 3px; padding: 3px; vertical-align: baseline; width: 640px;">CC=gcc
LD=ld
</code></pre>
<ul style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; list-style: inside; margin: 0px 0px 15px; padding: 0px 0px 0px 20px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Generate libtomcrypt.a file</li>
</ul>
<pre style="background-color: white; border-radius: 2px; border: 0px; box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 10px; color: #222222; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 14px; font-stretch: inherit; line-height: inherit; overflow: auto; padding: 10px; vertical-align: baseline; width: 640px;"><code style="border-radius: 2px; border: 0px; box-shadow: none; display: block; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 3px; padding: 3px; vertical-align: baseline; width: 640px;">$ make
</code></pre>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
The generated lib file in “libtomcrypt-1.17” directory.</div>
<ul style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; list-style: inside; margin: 0px 0px 15px; padding: 0px 0px 0px 20px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><div style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
Copy AN0060 encrypt.c into “libtomcrypt-1.17” directory.<br />
The file can be found in C:\SiliconLabs\SimplicityStudio\v2\developer\sdks\efm32\v2\an\an0060_efm32_aes_bootloader\src\encrypt\encrypt.c</div>
</li>
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><div style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
Modify encrypt.c to support AES128, save and close it.<br />
On line 51 change the AES_KEY_SIZE from 32 to 16</div>
</li>
</ul>
<pre style="background-color: white; border-radius: 2px; border: 0px; box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 10px; color: #222222; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 14px; font-stretch: inherit; line-height: inherit; overflow: auto; padding: 10px; vertical-align: baseline; width: 640px;"><code class="language-c" style="border-radius: 2px; border: 0px; box-shadow: none; display: block; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 3px; padding: 3px; vertical-align: baseline; width: 640px;">-#define AES_KEY_SIZE 32
+#define AES_KEY_SIZE 16
</code></pre>
<ul style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; list-style: inside; margin: 0px 0px 15px; padding: 0px 0px 0px 20px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Generate encrypt.exe</li>
</ul>
<pre style="background-color: white; border-radius: 2px; border: 0px; box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 10px; color: #222222; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 14px; font-stretch: inherit; line-height: inherit; overflow: auto; padding: 10px; vertical-align: baseline; width: 640px;"><code style="border-radius: 2px; border: 0px; box-shadow: none; display: block; font-family: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 3px; padding: 3px; vertical-align: baseline; width: 640px;">$ gcc -o encrypt encrypt.c -I./src/headers -L./ -ltomcrypt
</code></pre>
<div style="background-color: #f2f2f2; border: 0px; color: #373737; font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 24px; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
The generated encrypt.exe in “libtomcrypt-1.17” directory.</div>
<div style="background-color: #f2f2f2; border: 0px; font-stretch: inherit; margin-bottom: 15px; margin-top: 10px; padding: 0px; vertical-align: baseline;">
<span style="color: #373737; font-family: Myriad Pro, Calibri, Helvetica, Arial, sans-serif;"><span style="line-height: 24px;">http://markding.github.io/2014/12/25/efm32-an0060-encrypt-aes128-support.html</span></span></div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-79036678656560634052014-06-24T03:11:00.000-07:002014-09-29T19:29:11.480-07:00Implementing USB communication device class (CDC) on EFM32GG MCUs<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 2em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
1. Introduction</h2>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
USB revolutionized the PC peripheral space by making a very simple plug-and-play interface for users. As a result, many modern computers no longer support RS-232 serial COM ports, opting for the slimmer USB alternative. This can be an issue for the developer who needs a COM port for communication between a peripheral and host PC. A subset of the USB Communication DeviceClass (CDC) can be used to emulate a serial port providing a virtual COM port UART interface. This allows developers to use legacy applications with new products using the same COM port interface as before, with few hardware and software modifications.</div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<a href="https://camo.githubusercontent.com/46a11b659f7f306c47dae7ee7c3ddec372c02d26/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f7573625f6364635f696e74726f2e706e67" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;" target="_blank"><img alt="USB CDC Intro" data-canonical-src="https://raw.github.com/MarkDing/lufa-efm32/efm32/src/Demos/Device/LowLevel/EFM32Demos/images/usb_cdc_intro.png" src="https://camo.githubusercontent.com/46a11b659f7f306c47dae7ee7c3ddec372c02d26/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f7573625f6364635f696e74726f2e706e67" style="border: 0px; box-sizing: border-box; max-width: 100%;" title="USB CDC Virtual COM POrt system" /></a></div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<strong style="box-sizing: border-box;">Figure 1 USB CDC Virtual COM Port System</strong></div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
This application note describes the USB communications device class driver (or USB CDC) in detail and includes an implementation example for the Silicon Labs EFM32 Giant Gecko MCU.</div>
<h3 style="box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.5em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#11-assumptions" name="user-content-11-assumptions" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>1.1. Assumptions</h3>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
This document assumes the following:</div>
<ul class="task-list" style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; padding: 0px 0px 0px 30px;">
<li style="box-sizing: border-box;">A working knowledge of the C programming language.</li>
<li style="box-sizing: border-box;">Familiarity with the USB 2.0 specification and terms and abbreviations defined by the USB specification.</li>
<li style="box-sizing: border-box;">Familiarity with Silicon Labs EFM32GG development environment.</li>
</ul>
<h3 style="box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.5em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#12-features-and-limitations" name="user-content-12-features-and-limitations" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>1.2. Features and Limitations</h3>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
The CDC firmware implemented with this application note includes the following features:</div>
<ul class="task-list" style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; padding: 0px 0px 0px 30px;">
<li style="box-sizing: border-box;">Emulates a serial COM port on PC that supports the CDC Abstract Control Model (ACM).</li>
<li style="box-sizing: border-box;">Provides an abstract communication interface for data transfers between the host and the device.</li>
<li style="box-sizing: border-box;">Handles standard Chapter 9 USB device requests.</li>
<li style="box-sizing: border-box;">Handles CDC-specific requests from USB host.</li>
<li style="box-sizing: border-box;">Notifies the USB host of status using an interrupt endpoint.</li>
<li style="box-sizing: border-box;">Provides data communication with the USB host using a bulk endpoint.</li>
<li style="box-sizing: border-box;">The following baud rates are supported: 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 76800, 115200 and 230400 bps.</li>
</ul>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
The example does not implement the following:</div>
<ul class="task-list" style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; padding: 0px 0px 0px 30px;">
<li style="box-sizing: border-box;">No CTS/RTS control is performed, so flow control must be set to nonein the terminal program.</li>
<li style="box-sizing: border-box;">RTS/DTR control is not implemented.</li>
</ul>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 2em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#2-relevant-documentation" name="user-content-2-relevant-documentation" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>2. Relevant Documentation</h2>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
EFM32 Giant Gecko Application Notes are listed on the following website: <a href="http://www.silabs.com/32bit-appnotes" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;">www.silabs.com/32bit-appnotes</a>.</div>
<ul class="task-list" style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; padding: 0px 0px 0px 30px;">
<li style="box-sizing: border-box;"><strong style="box-sizing: border-box;">AN758 IMPLEMENTING USB COMMUNICATION DEVICE CLASS (CDC) ON SiM3U1XX MCUs</strong> -- provides an implementation example on porting LUFA USB CDC on SiM3U1xx MCUs.</li>
<li style="box-sizing: border-box;"><strong style="box-sizing: border-box;">AN0822 SIMPLICITY STUDIO USER’S GUIDE</strong> -- provides a description of the Simplicity Studio IDE features and environment.</li>
<li style="box-sizing: border-box;"><strong style="box-sizing: border-box;">AN0065 EFM32 as USB Device</strong> -- provides a description of the EFM32 USB Device stack.</li>
</ul>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 2em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#3-usb-cdc-class" name="user-content-3-usb-cdc-class" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>3. USB CDC Class</h2>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
The USB communications device class (CDC) is a composite USB device class, and the class may include more than one interface. The CDC is used primarily for modems, but also for ISDN, fax machines, and telephony applications for performing regular voice calls. The Abstract Control Model subclass of CDC and bridges the gap between legacy modem devices and USB devices, enabling the use of application programs designed for older modems.</div>
<h3 style="box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.5em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#31-class-requests" name="user-content-31-class-requests" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>3.1. Class Requests</h3>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
The class requests and class notifications supported are listed in Table 1.</div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<strong style="box-sizing: border-box;">Table 1. Abstract Control Model Requests</strong></div>
<table style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #333333; display: block; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; overflow: auto; width: 728px;"><thead style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Request</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Code</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Description</th></tr>
</thead><tbody style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">SET_LINE_CODING</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">20h</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Configures baud rate, stop-bits, parity, and numberof-character bits.</td></tr>
<tr style="background-color: #f8f8f8; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">GET_LINE_CODING</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">21h</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Requests current DTE rate, stop-bits, parity, and number-of-character bits.</td></tr>
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">SET_CONTROL_LINE_STATE</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">22h</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">RS232 signalused to tell the DCE device the DTE device is now present.</td></tr>
</tbody></table>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
These class-specific requests are used for device and call management.</div>
<h3 style="box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.5em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#311-set-line-coding" name="user-content-311-set-line-coding" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>3.1.1. Set Line Coding</h3>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
This request allows the host to specify typical asynchronous line-character formatting properties.</div>
<table style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #333333; display: block; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; overflow: auto; width: 728px;"><thead style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bmRequestType</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bRequest</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">wValue</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">wIndex</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">wLength</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Data</th></tr>
</thead><tbody style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">00100001b</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">SET_LINE_CODING</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">0</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">interface</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">size of structure</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">line coding structure</td></tr>
</tbody></table>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
Table 2 defines the line coding properties.</div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<strong style="box-sizing: border-box;">Table 2. Line Coding Format</strong></div>
<table style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #333333; display: block; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; overflow: auto; width: 728px;"><thead style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Offset</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Field</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Size</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Value</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Description</th></tr>
</thead><tbody style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">0</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">dwDTERate</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">4</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Number</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Data terminal rate, in bits per second.</td></tr>
<tr style="background-color: #f8f8f8; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">4</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bCharFormat</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">1</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Number</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">0: 1 Stop bit<br />
1: 1.5 Stop bits<br />
2: 2 Stop bits</td></tr>
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">5</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bParityType</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">1</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Number</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Parity:<br />
0:None<br />
1: Odd<br />
2: Even<br />
3: Mark<br />
4: Space</td></tr>
<tr style="background-color: #f8f8f8; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">6</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bDataBits</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">1</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Number</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Data bits (5, 6, 7, 8 or 16).</td></tr>
</tbody></table>
<h3 style="box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.5em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#312-get-line-coding" name="user-content-312-get-line-coding" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>3.1.2. Get Line Coding</h3>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
This request allows the host to find out the currently configured line coding. Table 2 defines the line coding properties.</div>
<table style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #333333; display: block; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; overflow: auto; width: 728px;"><thead style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bmRequestType</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bRequest</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">wValue</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">wIndex</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">wLength</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Data</th></tr>
</thead><tbody style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">10100001b</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">GET_LINE_CODING</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">0</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">interface</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">size of structure</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">line coding structure</td></tr>
</tbody></table>
<h3 style="box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.5em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#313-set-control-line-state" name="user-content-313-set-control-line-state" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>3.1.3. Set Control Line State</h3>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
This request generates RS-232/V.24 style control signals. Table 3 defines control signal bitmap.</div>
<table style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #333333; display: block; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; overflow: auto; width: 728px;"><thead style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bmRequestType</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bRequest</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">wValue</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">wIndex</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">wLength</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Data</th></tr>
</thead><tbody style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">00100001b</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">SET_LINE_CONTROL_STATE</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">control signal bitmap</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">interface</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">0</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">none</td></tr>
</tbody></table>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<strong style="box-sizing: border-box;">Table 3. Control Signal Bitmap</strong></div>
<table style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #333333; display: block; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; overflow: auto; width: 728px;"><thead style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Bit Position</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Description</th></tr>
</thead><tbody style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">15:2</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Reserved (Reset to zero).</td></tr>
<tr style="background-color: #f8f8f8; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">1</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Carrier control for half duplex modems. This signal corresponds to V.24 signal 105 and RS232 signal RTS.<br />
0: Deactivate carrier.<br />
1: Activate carrier.<br />
The device ignores the value of this bit when operating in full duplex mode.</td></tr>
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">0</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Indicates to DCE if DTE is present or not.This signal corresponds to V.24 signal 108/2 and RS232 signal DTR.<br />
0: DTE is not present.<br />
1: DTE is present</td></tr>
</tbody></table>
<h3 style="box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.5em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#32-class-notifictions" name="user-content-32-class-notifictions" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>3.2. Class Notifictions</h3>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
Table 4 shows the class notifications supported by the Abstract Control Model.</div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<strong style="box-sizing: border-box;">Table 4. Abstract Control Model Notifications</strong></div>
<table style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #333333; display: block; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; overflow: auto; width: 728px;"><thead style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Notification</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Code</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Description</th></tr>
</thead><tbody style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">SERIAL_STATE</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">20h</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Returns the current state of the carrier detects, DSR, break, and ring signal.</td></tr>
</tbody></table>
<h3 style="box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.5em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#serial-state" name="user-content-serial-state" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>Serial State</h3>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
This notification sends an asynchronous message containing the current UART status.</div>
<table style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #333333; display: block; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; overflow: auto; width: 728px;"><thead style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bmRequestType</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bRequest</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">wValue</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">wIndex</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">wLength</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Data</th></tr>
</thead><tbody style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">10100001b</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">SERIAL_STATE</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">0</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">interface</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">2</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">UART state bitmap</td></tr>
</tbody></table>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
The data field for this notification is a bitmapped value that contains the current state of detects transmission carrier, break, ring signal, and device overrun error. These signals are typically found on a UART and are used for communication status reporting. A state is considered enabled if its respective bit is set to 1.</div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<strong style="box-sizing: border-box;">Note</strong>: The firmware example included with this application does not currently support state change</div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<strong style="box-sizing: border-box;">Table 5. UART State Bitmap</strong></div>
<table style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #333333; display: block; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; overflow: auto; width: 728px;"><thead style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Bit Position</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Field</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Description</th></tr>
</thead><tbody style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">15:7</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;"></td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Reserved (future use).</td></tr>
<tr style="background-color: #f8f8f8; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">6</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bOverRun</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Received data has been discarded due to overrun in the device.</td></tr>
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">5</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bParity</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">A parity error occurred.</td></tr>
<tr style="background-color: #f8f8f8; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">4</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bFraming</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">A framing error occurred.</td></tr>
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">3</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bRingSignal</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">State of ring signal detection of the device.</td></tr>
<tr style="background-color: #f8f8f8; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">2</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bBreak</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">State of break detection mechanism of the device.</td></tr>
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">1</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bTxCarrier</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">State of transmission carrier. This signal corresponds to V.24 signal 106 and RS232 signal DSR.</td></tr>
<tr style="background-color: #f8f8f8; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">0</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">bRxCarrier</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">State of receiver carrier detection mechanism of device. This signal corresponds to V.24 signal 109 and RS232 signal DCD</td></tr>
</tbody></table>
<h3 style="box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.5em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#33-endpoint-configuration" name="user-content-33-endpoint-configuration" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>3.3. Endpoint Configuration</h3>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
Table 6 illustrates the endpoint configuration for the Abstract Control Model.</div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<strong style="box-sizing: border-box;">Table 6. UART State Bitmap</strong></div>
<table style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #333333; display: block; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; overflow: auto; width: 728px;"><thead style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Endpoint</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Direction</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Type</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Max Packet Size</th><th style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Description</th></tr>
</thead><tbody style="box-sizing: border-box;">
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">EP0</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">In/Out</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Control</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">64</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Standard requests, class requests.</td></tr>
<tr style="background-color: #f8f8f8; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">EP1</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">In</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Interrupt</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">16</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">State notification from device to host.</td></tr>
<tr style="background-color: white; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">EP2</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">In</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Bulk</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">64</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Data transferfrom device to host.</td></tr>
<tr style="background-color: #f8f8f8; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; box-sizing: border-box;"><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">EP3</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Out</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Bulk</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">64</td><td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; padding: 6px 13px;">Data transfer from host to device.</td></tr>
</tbody></table>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
Figure 2 shows a standard CDC communication flow.</div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<a href="https://camo.githubusercontent.com/7a4991baf1a4fe9a413686fc575209c6914e16a2/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f4344435f636f6d5f666c6f772e706e67" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;" target="_blank"><img alt="CDC USB LOG" data-canonical-src="https://raw.github.com/MarkDing/lufa-efm32/efm32/src/Demos/Device/LowLevel/EFM32Demos/images/CDC_com_flow.png" src="https://camo.githubusercontent.com/7a4991baf1a4fe9a413686fc575209c6914e16a2/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f4344435f636f6d5f666c6f772e706e67" style="border: 0px; box-sizing: border-box; max-width: 100%;" title="CDC USB log" /></a></div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<strong style="box-sizing: border-box;">Figure 2. USB CDC Communication FLow</strong></div>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 2em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#4-lufa-usb-stack" name="user-content-4-lufa-usb-stack" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>4. LUFA USB Stack</h2>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
The USB CDC firmware example is based on the <code style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;">LUFA</code> open-source project. <code style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;">LUFA</code> is an open-source complete USB stack released under the permissive MIT License. It includes support for many USB classes, both for USB Hosts and USB Devices. For USB Devices, the <code style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;">LUFA</code> stack includes support for Audio Class, CDC Class, HID Class, Mass Storage Class, MIDI Class, and RNDIS Class. More information about the <code style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;">LUFA</code> project can be found on the official website: <a href="http://www.fourwalledcubicle.com/LUFA.php" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;">http://www.fourwalledcubicle.com/LUFA.php</a></div>
<ul class="task-list" style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; padding: 0px 0px 0px 30px;">
<li style="box-sizing: border-box;">The USB CDC project contains a prebuilt LUFA USB stack documentation which locate at .\LUFA\Documentation\html. Double click on the index.html, the documentations shows in your default browser.</li>
</ul>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<a href="https://camo.githubusercontent.com/e6c0514b6b69ae47e5048ed2d5194a13007db5a7/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f6c7566612d646f63756d656e746174696f6e2e706e67" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;" target="_blank"><img alt="LUFA documentation" data-canonical-src="https://raw.github.com/MarkDing/lufa-efm32/efm32/src/Demos/Device/LowLevel/EFM32Demos/images/lufa-documentation.png" src="https://camo.githubusercontent.com/e6c0514b6b69ae47e5048ed2d5194a13007db5a7/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f6c7566612d646f63756d656e746174696f6e2e706e67" style="border: 0px; box-sizing: border-box; max-width: 100%;" title="LUFA USB documentation" /></a></div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<strong style="box-sizing: border-box;">Figure 3. USB LUFA Libary Documentation</strong></div>
<ul class="task-list" style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; padding: 0px 0px 0px 30px;">
<li style="box-sizing: border-box;">This implementation support two boards of EFM32GG, STK3700 and DK3750. Default setting is DK3750, To change board selection, just modify macro definition in .\LUFA\Common\BoardTypes.h.</li>
</ul>
<div class="highlight highlight-c" style="background: rgb(255, 255, 255); box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px;">
<pre style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13px; line-height: 19px; margin-bottom: 15px; margin-top: 15px; overflow: auto; padding: 6px 10px; word-wrap: normal;"><span class="cp" style="box-sizing: border-box; color: #999999; font-weight: bold;">#if !defined(__DOXYGEN__)</span>
<span class="cp" style="box-sizing: border-box; color: #999999; font-weight: bold;"> #define BOARD_ BOARD_DK3750</span>
<span class="cp" style="box-sizing: border-box; color: #999999; font-weight: bold;"> #if !defined(BOARD)</span>
<span class="cp" style="box-sizing: border-box; color: #999999; font-weight: bold;"> #define BOARD BOARD_DK3750</span>
<span class="cp" style="box-sizing: border-box; color: #999999; font-weight: bold;"> #endif</span>
<span class="cp" style="box-sizing: border-box; color: #999999; font-weight: bold;">#endif</span>
</pre>
</div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
For STK3700 board, there is no UART socket on board. UART signals are connected to EXP Header.</div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<a href="https://camo.githubusercontent.com/d5226061fb1bec80ccc9829f09d1c2e417e67929/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f75736172745f7369676e616c735f6f6e5f4558505f6865616465722e706e67" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;" target="_blank"><img alt="USART on EXP" data-canonical-src="https://raw.github.com/MarkDing/lufa-efm32/efm32/src/Demos/Device/LowLevel/EFM32Demos/images/usart_signals_on_EXP_header.png" src="https://camo.githubusercontent.com/d5226061fb1bec80ccc9829f09d1c2e417e67929/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f75736172745f7369676e616c735f6f6e5f4558505f6865616465722e706e67" style="border: 0px; box-sizing: border-box; max-width: 100%;" title="USART signals on STK3700 Expansion Header" /></a></div>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
<strong style="box-sizing: border-box;">Figure 4. USART signals on STK3700 Expansion Header</strong></div>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 2em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#5-usb-cdc-driver" name="user-content-5-usb-cdc-driver" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>5. USB CDC Driver</h2>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
The CDC class is implemented in all releases of Windows, and the operatingsystem needs an INF file for the CDC driver. This INF file contains the Vendor ID and Product ID. If the VID/PID of the USB devices matches the INF file, Windows will load the driver described in the file. The <strong style="box-sizing: border-box;">VirtualSerial.inf</strong> file can be found in the<strong style="box-sizing: border-box;">.\Demos\Device\LowLevel\EFM32Demos\VCP</strong> directory.</div>
<h3 style="box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.5em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#installing-the-driver" name="user-content-installing-the-driver" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>Installing the Driver</h3>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-bottom: 15px; margin-top: 15px;">
To install the driver on Windows 7:</div>
<ol class="task-list" style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin: 15px 0px; padding: 0px 0px 0px 30px;">
<li style="box-sizing: border-box;">Build the project and download firmware to the EFM32GG DK3750 board.</li>
<li style="box-sizing: border-box;">Connect the USB cable between the Device MCU plugin board USB connector and the PC.</li>
<li style="box-sizing: border-box;">Open Device Manager. The device will appear under <strong style="box-sizing: border-box;">Other devices</strong> as the <strong style="box-sizing: border-box;">EFM32GG CDC Device</strong>. <a href="https://camo.githubusercontent.com/821c0ac3ab5d5ed7aa9c378bd997e97650d1e328/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f6465766963655f6d616e616765722e706e67" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;" target="_blank"><img alt="Device Manager" data-canonical-src="https://raw.github.com/MarkDing/lufa-efm32/efm32/src/Demos/Device/LowLevel/EFM32Demos/images/device_manager.png" src="https://camo.githubusercontent.com/821c0ac3ab5d5ed7aa9c378bd997e97650d1e328/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f6465766963655f6d616e616765722e706e67" style="border: 0px; box-sizing: border-box; max-width: 100%;" /></a></li>
<li style="box-sizing: border-box;">Right-click on the <strong style="box-sizing: border-box;">EFM32GG CDC Device</strong> and select <strong style="box-sizing: border-box;">Update Driver Software</strong>. <a href="https://camo.githubusercontent.com/e0cff3dc764948d9644742b89b3d0a3ed5597cf4/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f6465766963655f6d616e616765725f7570646174652e706e67" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;" target="_blank"><img alt="Device Manager Update" data-canonical-src="https://raw.github.com/MarkDing/lufa-efm32/efm32/src/Demos/Device/LowLevel/EFM32Demos/images/device_manager_update.png" src="https://camo.githubusercontent.com/e0cff3dc764948d9644742b89b3d0a3ed5597cf4/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f6465766963655f6d616e616765725f7570646174652e706e67" style="border: 0px; box-sizing: border-box; max-width: 100%;" /></a></li>
<li style="box-sizing: border-box;">Select <strong style="box-sizing: border-box;">Browse my computer for driver software</strong>. <a href="https://camo.githubusercontent.com/4018bc31ec8f66a89ec1183cca0863406ae9e506/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f7570646174655f6472697665725f736f6674776172652e706e67" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;" target="_blank"><img alt="Updata Driver Software" data-canonical-src="https://raw.github.com/MarkDing/lufa-efm32/efm32/src/Demos/Device/LowLevel/EFM32Demos/images/update_driver_software.png" src="https://camo.githubusercontent.com/4018bc31ec8f66a89ec1183cca0863406ae9e506/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f7570646174655f6472697665725f736f6674776172652e706e67" style="border: 0px; box-sizing: border-box; max-width: 100%;" /></a></li>
<li style="box-sizing: border-box;">Select <strong style="box-sizing: border-box;">Browse my computer for driver software</strong>. <a href="https://camo.githubusercontent.com/4b791aee5404e3a8309f78821550378aab0c1d1a/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f62726f7773655f6472697665725f736f6674776172652e706e67" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;" target="_blank"><img alt="Browse Driver Software" data-canonical-src="https://raw.github.com/MarkDing/lufa-efm32/efm32/src/Demos/Device/LowLevel/EFM32Demos/images/browse_driver_software.png" src="https://camo.githubusercontent.com/4b791aee5404e3a8309f78821550378aab0c1d1a/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f62726f7773655f6472697665725f736f6674776172652e706e67" style="border: 0px; box-sizing: border-box; max-width: 100%;" /></a></li>
<li style="box-sizing: border-box;">Windows will display a warning. Select <strong style="box-sizing: border-box;">Install this driversoftware anyway</strong>. <a href="https://camo.githubusercontent.com/e90f2d15311dce71c22223fa8c506bf892503708/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f77696e646f77735f73656375726974792e706e67" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;" target="_blank"><img alt="Windows Sercurity" data-canonical-src="https://raw.github.com/MarkDing/lufa-efm32/efm32/src/Demos/Device/LowLevel/EFM32Demos/images/windows_security.png" src="https://camo.githubusercontent.com/e90f2d15311dce71c22223fa8c506bf892503708/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f77696e646f77735f73656375726974792e706e67" style="border: 0px; box-sizing: border-box; max-width: 100%;" /></a></li>
<li style="box-sizing: border-box;">When the driver finishes installing,Windows will report the installation results.</li>
<li style="box-sizing: border-box;">Open Device Manager and observethe device. It will now appear under <strong style="box-sizing: border-box;">Ports (COM & LPT)</strong> with an assigned COM port number. <a href="https://camo.githubusercontent.com/25b3ca6b62490decef89068e247bb0334815cd52/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f6465766963655f6d616e616765725f646f6e652e706e67" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;" target="_blank"><img alt="Device Manager Done" data-canonical-src="https://raw.github.com/MarkDing/lufa-efm32/efm32/src/Demos/Device/LowLevel/EFM32Demos/images/device_manager_done.png" src="https://camo.githubusercontent.com/25b3ca6b62490decef89068e247bb0334815cd52/68747470733a2f2f7261772e6769746875622e636f6d2f4d61726b44696e672f6c7566612d65666d33322f65666d33322f44656d6f732f4465766963652f4c6f774c6576656c2f45464d333244656d6f732f696d616765732f6465766963655f6d616e616765725f646f6e652e706e67" style="border: 0px; box-sizing: border-box; max-width: 100%;" /></a></li>
</ol>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 2em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/MarkDing/lufa-efm32#contact-information" name="user-content-contact-information" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; bottom: 0px; box-sizing: border-box; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a></h2>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 2em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
Source code</h2>
<div>
Source code can be found in https://github.com/MarkDing/lufa-efm32. </div>
<div>
<br /></div>
<div>
Github page in http://markding.github.io/lufa-efm32/. </div>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 2em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
</h2>
<h2 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 2em; line-height: 1.7; margin: 1em 0px 15px; padding: 0px; position: relative;">
CONTACT INFORMATION</h2>
<div style="box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; line-height: 25.5px; margin-top: 15px;">
<strong style="box-sizing: border-box;">Silicon Laboratories Inc.</strong> 400 West Cesar Chavez<br />
Austin, TX 78701<br />
Tel: 1+(512) 416-8500<br />
Fax: 1+(512) 416-9669<br />
Toll Free: 1+(877) 444-3032<br />
Please visit the Silicon Labs Technical Support web page:<br />
<a href="https://www.silabs.com/support/pages/contacttechnicalsupport.aspx" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: border-box; color: #4183c4; text-decoration: none;">https://www.silabs.com/support/pages/contacttechnicalsupport.aspx</a><br />
and register to submit a technical support request.</div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com1tag:blogger.com,1999:blog-6138180379582869534.post-62256234857964104082014-03-14T01:29:00.000-07:002014-03-14T01:32:55.652-07:00Programming internal SRAM over SWD<div style="border-bottom: solid #DDDDDD 1.0pt; border: none; mso-border-bottom-alt: solid #DDDDDD .75pt; mso-element: para-border-div; padding: 0in 0in 0in 0in;">
<div class="MsoNormal" style="border: none; margin-bottom: 11.25pt; padding: 0in;">
<br /></div>
</div>
<div style="border-bottom: solid #EEEEEE 1.0pt; border: none; mso-border-bottom-alt: solid #EEEEEE .75pt; mso-element: para-border-div; padding: 0in 0in 0in 0in;">
<div class="MsoNormal" style="border: none; margin: 12pt 0in 11.25pt; padding: 0in;">
<a href="https://draft.blogger.com/null" name="1-introduction"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 24.0pt; mso-fareast-font-family: "Times New Roman";">1.
Introduction<o:p></o:p></span></b></div>
</div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">This documentation describe how to programming ARM Cortex M3
internal SRAM over SWD(Serial Wire Debug) interface. For this purpose,
something we too know.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l9 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">SWD communication protocol. We need to know Low level timing
requirement, that is foundation to exchange command and data between debugger
and target MCU.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l9 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Read/write data from/to internal SRAM. We need to know how to
program firmware into desired address, like SRAM(0x20000000). That needs us to
know SW-DAP registers usage. Pass address and data over those registers and
then into internal SRAM.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l9 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Make code running from SRAM. We need to change vector table
entry from internal flash to SRAM; And SP and PC also needed change to SRAM
location. That need us to know the cortex M3 debug and system registers usage.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">We choose Silabs SiM3U167 as target MCU in this implementation.
We implement a high level protocol with python script, it calls Silabs provided
DLL file interface to access Silabs USB Debug Adapter. Also, we provide a
firmware running from C8051F380, it contains a full implementation on both low
level communicating timing and high level programming SRAM protocol.<o:p></o:p></span></div>
<div style="border-bottom: solid #EEEEEE 1.0pt; border: none; mso-border-bottom-alt: solid #EEEEEE .75pt; mso-element: para-border-div; padding: 0in 0in 0in 0in;">
<div class="MsoNormal" style="border: none; margin: 12pt 0in 11.25pt; padding: 0in;">
<a href="https://draft.blogger.com/null" name="2-serial-wire-debug-overview"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 24.0pt; mso-fareast-font-family: "Times New Roman";">2. Serial Wire Debug overview<o:p></o:p></span></b></div>
</div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Serial Wire Debug (SWD) is a 2-pin (SWDIO/SWCLK) electrical
alternative JTAG interface that has the same JTAG protocol on top. SWD uses an
ARM CPU standard bi-directional wire protocol, defined in the ARM Debug
Interface v5. This enables the debugger to become another AMBA bus master for
access to system memory and peripheral or debug registers.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">The Debug Access Port(DAP) is split into two main control units.
the Debug Port (DP) and the Access Port (AP), and the physical connection to
the debugger is part of the DP. The DAP supports two types of access, Debug
Port (DP) accesses and Access Port (AP)accesses. External device to communicate
directly with Serial Wire Debug Port(SW-DP) over SWDIO/SCLK pins. And SW-DP in
turn can access one or several Access Ports(APs) the give access to the rest of
the system. The MEM-AP is important AP which provide a way to access all memory
and peripheral registers residing on the internal AHB/APB buses.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Figure 1 ARM Debug Interface MEM-AP
Implementation</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXYxI7gFfJpDVWq1mW9oQnMmThNZrMp_Mx1MZhGYTulWGRQbH2gb2R1-5vTg7rJlNelaEa9A0zbmuqRJCv-T-q5fzZNUvOS1qteXJr33oWbeIw3HMXbrkTkpSpmM-UFOHuSdrl99DeVVlE/s1600/adi_mem-ap.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXYxI7gFfJpDVWq1mW9oQnMmThNZrMp_Mx1MZhGYTulWGRQbH2gb2R1-5vTg7rJlNelaEa9A0zbmuqRJCv-T-q5fzZNUvOS1qteXJr33oWbeIw3HMXbrkTkpSpmM-UFOHuSdrl99DeVVlE/s1600/adi_mem-ap.png" /></a></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span style="color: #333333; font-family: Helvetica, sans-serif; font-size: 11.5pt; line-height: 19.15pt;">One of the four registers within the DP is the AP Select
Register, SELECT. This register specifies a particular Access Port, and a bank
of four 32-bit words within the register map of that AP. It enables up to 256
Access Ports to be implemented, and gives access to any one of 16 four-word banks
of registers on the selected AP.</span></div>
<div style="border-bottom: solid #EEEEEE 1.0pt; border: none; mso-border-bottom-alt: solid #EEEEEE .75pt; mso-element: para-border-div; padding: 0in 0in 0in 0in;">
<div class="MsoNormal" style="border: none; margin: 12pt 0in 11.25pt; padding: 0in;">
<a href="https://draft.blogger.com/null" name="3-swd-protocol"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 24.0pt; mso-fareast-font-family: "Times New Roman";">3.
SWD protocol<o:p></o:p></span></b></div>
</div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">This section gives an overview of the bi-directional operation
of the protocol. It illustrates each of the possible sequences of operations on
the Serial Wire Debug interface data connection.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="31-connection-and-line-reset-sequence"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">3.1. Connection and line reset sequence<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">The SW-DP must use connection sequence of 50 clock cycles with
data = 1. And this sequence is also used as a line reset sequence which
requires 50 consecutive 1s on the data input.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">JTAG to SWD switching</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">SWJ-DP enables either an SWD or JTAG protocol to be used on the
debug port. To do this, it implements a watcher circuit that detects a specific
16-bit selection sequence on the SWDIOTMSpin:<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">The 16-bit JTAG-to-SWD select sequence is defined to be
0b0111100111100111, MSB first. This can be represented as 16'h79E7 if
transmitted MSB first or 16'hE79E if transmitted LSB first.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">The host must read IDCODE register after line request sequence.
This requirement gives confirmation that correct packet frame alignment has
been achieved.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="32-successful-transaction-operation"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">3.2. Successful transaction operation<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">A successful transaction contains three phases.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l3 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Host sending an eight-bit write packet request to target.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l3 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Target response with a three-bit OK acknowledge to host.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l3 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">A 33-bit data phase, either from host or target depends on
write/read operation.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Figure 2 Serial Wire Debug successful write
operation</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9OJ-wYWqhLyBJxjO2MR8f51mLSZvq4LuhTYwh83TYOBmdg6CqOXQ8npdaA8jNWLVskqqD2mBGmGGSJ9t_R7lCSCYDRx07qBip8M2mRQR5rJuxcUa_S7UUBfoRxiSnDJc8rolCA0w0A1a0/s1600/swd-write-portocol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9OJ-wYWqhLyBJxjO2MR8f51mLSZvq4LuhTYwh83TYOBmdg6CqOXQ8npdaA8jNWLVskqqD2mBGmGGSJ9t_R7lCSCYDRx07qBip8M2mRQR5rJuxcUa_S7UUBfoRxiSnDJc8rolCA0w0A1a0/s1600/swd-write-portocol.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">3.2.1. Packet request phase</span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">The request phase consists of 8 bits. The meaning of each bit in
the request is illustrated below.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l1 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">Start</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> -- A single start bit, with value 1.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l1 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">APnDP</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> -- A single bit, indicating whether the Debug Port or the
Access Port Access Register is to be accessed. 1 for accessing AP.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l1 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">RnW</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> -- A single bit, this bit is 0 for an write access, or 1
for a read access.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l1 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">A[2:3]</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> -- Two bits, giving the A[3:2] address field for the DP or
AP register address.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l1 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">Parity</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> -- A single odd parity bit is made over the APnDP, RnW and
A[2:3] bits. The number of bits set to 1 is odd, then the parity bit is set to
1.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l1 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">Stop</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> -- A single stop bit. In the synchronousSWD protocol this
is always 0.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l1 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">Park</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> -- A single bit, with value 1.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="322--acknowledge-response-phase"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">3.2.2. Acknowledge response phase<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">ACK phase is a three-bit(LSB-first) target to host response.
Three type ACK response.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l0 level1 lfo4; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">OK Response</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> -- It indicates successful operation, value is b001.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l0 level1 lfo4; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">WAIT response</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> -- The host must retry the operation later, value is b010.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l0 level1 lfo4; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">FAULT response</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> -- If the target responds with FAULT, an error has
occurred and one of the sticky bits in CTRL/STAT is set. The host can check the
sticky error bits to see what kind of error has occurred. It must clear the
sticky bits in ABORT register before using any AP commands, because the target
will always respond with FAULT as long as one of the sticky error bits are set.
Value is b100.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="323-data-transfer-phase"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">3.2.3. Data transfer phase<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">It contains 32 data bits and 1 parity bit. The The parity check
is made over the 32 data bits. The number of bits set to 1 is odd, then the
parity bit is set to 1.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="324-turnaround-period"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">3.2.4. Turnaround period<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">From figure above,
there is </span><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">Trn</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> -- Turnaround
period between each phase. Every time the SWDIO changes data direction, a
one-cycle turnaround period is inserted which both sides should ignore. This
means there is always a turnaround period between the request and acknowledge.
On a write request, there is a turnaround period between acknowledge and the
data phase. On a read request there is a a turnaround after the data phase.<o:p></o:p></span></div>
<div style="border-bottom: solid #EEEEEE 1.0pt; border: none; mso-border-bottom-alt: solid #EEEEEE .75pt; mso-element: para-border-div; padding: 0in 0in 0in 0in;">
<div class="MsoNormal" style="border: none; margin: 12pt 0in 11.25pt; padding: 0in;">
<a href="https://draft.blogger.com/null" name="4-serial-write-debug-portsw-dp-registers"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 24.0pt; mso-fareast-font-family: "Times New Roman";">4. Serial Write Debug Port(SW-DP) Registers<o:p></o:p></span></b></div>
</div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">This section will give a brief overview over the SW-DP
registers.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Table 1 SW-DP registers</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-yfti-tbllook: 1184; width: 722px;">
<thead>
<tr>
<td style="background: white; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Address<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Read<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write<o:p></o:p></span></b></div>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0x00<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">IDCODE<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">ABORT<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0x04<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">CTRL/STAT<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">CTRL/STAT<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0x08<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">RESEND<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">SELECT<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0x0C<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">RDBUFF<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">N/A<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="41-the-identification-code-register-idco"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">4.1. The Identification Code Register, IDCODE<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">IDCODE</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register
provides a identification information about SW-DP. On the EFM32 or SiM3U
devices with a Cortex-M3 or Cortex-M4 core this register should read
0x2BA01477. For devices with a CortexM0+ core the register should read
0x0BC11477.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="42-the-ap-abort-register-abort"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">4.2. The AP Abort Register, ABORT<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">ABORT</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register main
purpose is to force a DAP abort, and on a SW-DP it is also used to clear error
and sticky flag conditions. Here are the bit assignments of AP Abort register.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Table 2 ABORT register bit assignments</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-yfti-tbllook: 1184; width: 722px;">
<thead>
<tr>
<td style="background: white; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Bits<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Function<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Description<o:p></o:p></span></b></div>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[31:5]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">-<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Reserved<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[4]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">ORUNERRCLR<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write 1 to this bit to clear the STICKYORUN
overrun error flag to 0.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[3]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">WDERRCLR<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write 1 to this bit to clear the WDATAERR
write data error flag to 0<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[2]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">STKERRCLR<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write 1 to this bit to clear the STICKYERR
sticky error flag to 0.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[1]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">STKCMPCLRa<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write 1 to this bit to clear the STICKYCMP
sticky compare flag to 0.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[0]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">DAPABORT<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write 1 to this bit to generate a DAP abort.
This aborts the current AP transaction. Do this only if the debugger has
received WAIT responses over an extended period.<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">You might want to find what caused the flag to be set to 1.
Typically:<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l12 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">For the </span><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">STICKYCMP</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> or </span><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">STICKYERR</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> flag, you must find which location was accessed to cause
the flag to be set to 1.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l12 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">For the </span><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">WDATAERR</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> flag, you must resend the corrupted data.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l12 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">For the </span><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">STICKYORUN</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> flag, you must find which DP or AP transaction caused the
overflow. You then have to repeat your transactions from that point.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="43-the-controlstatus-register-ctrlstat"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">4.3. The Control/Status Register, CTRL/STAT<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">CTRL/STAT</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register
provides control of the DP and status information about the DP.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Figure 3 Control/Status Register bit
assignments</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnfxXZyPlo3RzxfUZ0lRj4-ma_kT8Irom_MTOKiy5iDJ-1-W7XS6ype52ZDvcmSQkiZXAJI0ZRn5qGJ6tXhte5zXnMhf9i_FNlX9uCp-zKZ0pzCVzcyh0NRHWBb7pjX5xcAVDwnjGquTN1/s1600/ctrl-stat-reg.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnfxXZyPlo3RzxfUZ0lRj4-ma_kT8Irom_MTOKiy5iDJ-1-W7XS6ype52ZDvcmSQkiZXAJI0ZRn5qGJ6tXhte5zXnMhf9i_FNlX9uCp-zKZ0pzCVzcyh0NRHWBb7pjX5xcAVDwnjGquTN1/s1600/ctrl-stat-reg.png" /></a></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10pt; line-height: 19.15pt; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><span lang="EN-SG" style="color: #333333; font-family: Helvetica, sans-serif; font-size: 11.5pt; line-height: 19.15pt; text-indent: -0.25in;">Bit [28] </span><span lang="EN-SG" style="background-color: #f8f8f8; background-position: initial initial; background-repeat: initial initial; border: 1pt solid rgb(221, 221, 221); color: #333333; font-family: Consolas; font-size: 9pt; line-height: 19.15pt; padding: 0in; text-indent: -0.25in;">CDBGPWRUPREQ</span><span lang="EN-SG" style="color: #333333; font-family: Helvetica, sans-serif; font-size: 11.5pt; line-height: 19.15pt; text-indent: -0.25in;"> is the signal from the debug interface to the power
controller, used to request the system power controller to fully power-up and
enable clocks in the debug power domain.</span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l2 level1 lfo6; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Bit [30] </span><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">CSYSPWRUPREQ</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> is the signal from the debug interface to the power
controller, used to request the system power controller to fully power-up and
enable clocks in the system power domain.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">The debugger must write a 1 to the CDBGPWRUPREQ and CSYSPWRUPREQ
bits before using the AHB-AP. The STICKYERR bit is set if an error is returned
by a AP transaction. While the STICKYERR bit is set any SWD request will return
a FAULT response. To clear the STICKYERR bit, use the ABORT register.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="44-the-ap-select-register-select"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">4.4. The AP Select Register, SELECT<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">SELECT</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register
specifies a particular Access Port, and a bank of four 32-bit words within the
register map of that AP. It enables up to 256 Access Ports to be implemented,
and gives access to any one of 16 four-word banks of registers on the selected
AP.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Table 3 Bit assignments for the AP Select
Register, SELECT</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-yfti-tbllook: 1184; width: 722px;">
<thead>
<tr>
<td style="background: white; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Bits<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Function<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Description<o:p></o:p></span></b></div>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[31:24]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">APSEL<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Selects the current AP.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[7:4]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">APBANKSEL<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Selects the active four-word register bank
on the current AP<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="45-the-read-buffer-rdbuff"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">4.5. The Read Buffer, RDBUFF<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">RDBUFF</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register return
the result of a previous read, without initiating a new AP transaction.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">If you require the value from an AP register read, that A read
of the DP Read Buffer must be followed.<o:p></o:p></span></div>
<div style="border-bottom: solid #EEEEEE 1.0pt; border: none; mso-border-bottom-alt: solid #EEEEEE .75pt; mso-element: para-border-div; padding: 0in 0in 0in 0in;">
<div class="MsoNormal" style="border: none; margin: 12pt 0in 11.25pt; padding: 0in;">
<a href="https://draft.blogger.com/null" name="5-memory-access-portmem-ap-registers"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 24.0pt; mso-fareast-font-family: "Times New Roman";">5. Memory Access Port(MEM-AP) Registers<o:p></o:p></span></b></div>
</div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">A MEM-AP provides a DAP with access to a memory subsystem. Since
memory, peripherals and debug components are all memory mapped, the MEM-AP can
be used to both program and debug Cortex M3.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Table 4 MEM-AP registers</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-yfti-tbllook: 1184; width: 722px;">
<thead>
<tr>
<td style="background: white; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Address<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Bank<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Function<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Description<o:p></o:p></span></b></div>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0x00<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0x00<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">CSW<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Control/Status Word Register<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0x04<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0x00<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">TAR<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Transfer Address Register<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0x0C<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0x00<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">DRW<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Data Read/Write Register<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0xFC<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0x0F<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">IDR<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Identification Register<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="51-controlstatus-word-csw-register"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">5.1. Control/Status Word (CSW) Register<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">CSW</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register
configures and controls accesses through the MEM-AP to or from a connect memory
system.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Table 5 Bit assignments for the MEM-AP
Control/Status Word Register, CSW</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-yfti-tbllook: 1184; width: 722px;">
<thead>
<tr>
<td style="background: white; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Bits<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Function<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Description<o:p></o:p></span></b></div>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[30:24]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Prot<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Bus access protection control. This field
enables the debugger to specify protection flags for a debug access.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[5:4]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">AddrInc<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Address auto-increment and packing mode.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[2:0]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Size<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">b000: 8 bits; b001: 16 bits; b010: 32 bits<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="52-the-transfer-address-register-tar"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">5.2. The Transfer Address Register (TAR)<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">TAR</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register holds
the memory address to be accessed. The contents of TAR can be incremented
automatically on a successful DRW access with b01 set in </span><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">AddrInc</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> field of </span><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">CSW</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="53-the-data-readwrite-register-drw"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">5.3. The Data Read/Write Register (DRW)<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">DRW</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register is used
to either write or read from the address held in TAR. To write a value to an
internal memory address, first write the address to the TAR register, then
write the value to DRW. To read a memory address, first write the address to
TAR, then read the value in DRW.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="54-the-identification-register-idr"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">5.4. The Identification Register, (IDR)<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">IDR</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register
identifies the Access Port. To read this register, the APBANKSEL field should
be set to 0xF. And then IDR register can be read with address 0x0C(ADDR[3:2] =
b11). The IDR register should return the value 0x24770011 on devices with a
Cortex-M3 or Cortex-M4 core. On devices with a Cortex-M0+ it should return
0x0477003<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKrKid1toa_RA-nkNoYt6z0JVcQjEbWyS-jSUdOZk5XkHdWJHQwGohqHl7lt7Qg__krqK4fJJZr9V4Q_8_-en_gYVqjw9CH4LEwVy6O04YBeESvLvS72v_BTdqShyVHJP7iA6YLRluuluU/s1600/idr-reg.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKrKid1toa_RA-nkNoYt6z0JVcQjEbWyS-jSUdOZk5XkHdWJHQwGohqHl7lt7Qg__krqK4fJJZr9V4Q_8_-en_gYVqjw9CH4LEwVy6O04YBeESvLvS72v_BTdqShyVHJP7iA6YLRluuluU/s1600/idr-reg.png" /></a></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 24.0pt; mso-fareast-font-family: "Times New Roman";">6. Debug and system Registers</span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">This section will go through the Cortex M3 Debug registers. With
debug registers, we can set core into halt mode and can change core registers,
like SP or PC.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Table 6 Debug and system registers</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-yfti-tbllook: 1184; width: 722px;">
<thead>
<tr>
<td style="background: white; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Address<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Name<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Description<o:p></o:p></span></b></div>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0xE000EDF0<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">DHCSR<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Debug Halting Control and Status Register<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0xE000EDF4<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">DCRSR<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Debug Core Register Selector Register<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0xE000EDF8<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">DCRDR<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Debug Core Register Data Register<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0xE000EDFC<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">DEMCR<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Debug Exception and Monitor Control Register<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0xE000ED0C<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">AIRCR<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Application Interrupt and Reset Control
Register<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="61-debug-halting-control-and-status-regi"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">6.1. Debug Halting Control and Status
Register, DHCSR<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">DHCSR</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register
controls halting debug. Halting debug is enabled when C_DEBUGEN is set to 1.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Table 7 DHCSR bit assignments</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-yfti-tbllook: 1184; width: 722px;">
<thead>
<tr>
<td style="background: white; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Bits<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Name<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Function<o:p></o:p></span></b></div>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[31:16]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">DBGKEY<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Debug key: A debugger must write 0xA05Fto
this field to enable write accesses to bits [15:0], otherwise the processor
ignores the write access.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[16]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">S_REGRDY<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">A handshake flag for transfers through the
DCRDR: 0 = There has been a write to the DCRDR, but the transfer is not
complete; 1 = The transfer to or from the DCRDR is complete.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[0]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">C_DEBUGEN<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Halting debug enable bit: 1 = Enabled<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="62-debug-core-register-selector-register"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">6.2. Debug Core Register Selector Register, DCRSR<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">DCRSR</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register
provides debug access to the ARM core registers, special-purpose registers, and
Floating-point extension registers. A write to DCRSR specifies the resister to
transfer.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Table 8 DCRSR bit assignments</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-yfti-tbllook: 1184; width: 722px;">
<thead>
<tr>
<td style="background: white; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Bits<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Name<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Function<o:p></o:p></span></b></div>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[16]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">REGWnR<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0 = read; 1= write<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[6:0]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">REGSEL<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Specifies the ARM core register,
special-purpose register, or Floating-point extension register, to transfer:
R0-R12, SP, LR, DebugReturnAddr, xPSR, MSP, PSP, etc.<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">DebugReturnAddress is the address of the first instruction to be
executed on exit from Debug state.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="63-debug-core-register-data-register-dcr"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">6.3. Debug Core Register Data Register, DCRDR<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">DCRDR</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register
provides debug access to ARM core register, special-purpose registers,and
Floating-point extension registers. The DCRDR is the data register for these
accesses.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Use of DCRSR and DCRDR</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l6 level1 lfo7; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">To transfer a data word to an ARM core register, special-purpose
register, orFloating-point extension register, a debugger:<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l6 level2 lfo7; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Writes the required
word to DCRDR.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l6 level2 lfo7; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Writes to the DCRSR,
with the REGSEL value indicating the required register, and the REGWnR bit as 1
to indicate a write access. This write clears the DHCSR S_REGRDY bit to 0.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l6 level2 lfo7; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">If required, polls
DHCSR until DHCSR.S_REGRDY reads-as-one. This shows that the processor has
transferred the DCRDR value to the selected register.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l6 level1 lfo7; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">To transfer a data word from an ARM core register,
special-purpose register, or Floating-point extension register, a debugger:<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l6 level2 lfo7; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Writes to the DCRSR,
with the REGSEL value indicating the required register, and the REGWnR bit as 0
to indicate a read access. This write clears the DHCSR.S_REGRDY bit to 0.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l6 level2 lfo7; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Polls DHCSR until
DHCSR.S_REGRDY reads-as-one. This shows that the processor has transferred the
value of the selected register to DCRDR.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l6 level2 lfo7; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Reads the required
value from DCRDR.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="64-debug-exception-and-monitor-control-r"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">6.4. Debug Exception and Monitor Control
Register, DEMCR<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">DEMCR</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register manages
vector catch behavior and DebugMonitor handling when debugging. Bits [23:16]
provide DebugMonitor exception control. Bits [15:0] provide Debug state,
halting debug, control.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Table 9 DEMCR bit assignments</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-yfti-tbllook: 1184; width: 722px;">
<thead>
<tr>
<td style="background: white; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Bits<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Name<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Function<o:p></o:p></span></b></div>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[10]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">VC_HARDERR<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Enable halting debug trap on a HardFault
exception<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[9]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">VC_INTERR<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Enable halting debug trap on a fault
occurring during exception entry or exception return.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[8]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">VC_BUSERR<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Enable halting debug trap on a BusFault
exception.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[7]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">VC_STATERR<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Enable halting debug trap on a UsageFault
exception caused by a state information error, for example an Undefined
Instruction exception.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[6]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">VC_CHKERR<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Enable halting debug trap on a UsageFault
exception caused by a checking error, for example an alignment check error.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[5]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">VC_NOCPERR<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Enable halting debug trap on a UsageFault
caused by an access to a Coprocessor.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[4]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">VC_MMERR<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Enable halting debug trap on a MemManage
exception.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[0]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">VC_CORERESET<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Enable Reset Vector Catch. This causes a
Local reset to halt a running system.<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Vector catch is the mechanism for generating a debug event and
entering Debug state when a particular exception occurs. Vector catching is
only supported by halting debug.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="65-application-interrupt-and-reset-contr"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">6.5. Application Interrupt and Reset Control
Register, AIRCR<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: .0001pt; margin-bottom: 0in;">
<span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">AIRCR</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> register sets or
returns interrupt control data.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Table 10 AIRCR bit assignments</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-yfti-tbllook: 1184; width: 722px;">
<thead>
<tr>
<td style="background: white; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Bits<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Name<o:p></o:p></span></b></div>
</td>
<td style="background: white; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div align="center" class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt; text-align: center;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Function<o:p></o:p></span></b></div>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[31:16]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">VECTKEY<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Vector Key. Register writes must write
0x05FAto this field, otherwise the write is ignored.On reads, returns 0xFA05.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[15]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">ENDIANNESS<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">0 = Little endian; 1 = Big endian<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[10:8]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">PRIGROUP<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Priority grouping<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[2]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">SYSRESETREQ<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Writing 1 to this bit asserts a signal to
the external system to request a Local reset.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: white; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[1]<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">VECTCLRACTIVE<o:p></o:p></span></div>
</td>
<td style="background: white; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Writing 1 to this bit clears all active
state information for fixed and configurable exceptions.<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #F8F8F8; border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">[0]<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">VECTRESET<o:p></o:p></span></div>
</td>
<td style="background: #F8F8F8; border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt;"><div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Writing 1 to this bit causes a local system
reset.<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div style="border-bottom: solid #EEEEEE 1.0pt; border: none; mso-border-bottom-alt: solid #EEEEEE .75pt; mso-element: para-border-div; padding: 0in 0in 0in 0in;">
<div class="MsoNormal" style="border: none; margin: 12pt 0in 11.25pt; padding: 0in;">
<a href="https://draft.blogger.com/null" name="7-sram-programing"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 24.0pt; mso-fareast-font-family: "Times New Roman";">7. SRAM programing<o:p></o:p></span></b></div>
</div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">This section demonstrate step by step how to programming
internal SRAM over SWD.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="71-initialization"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">7.1. Initialization<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Before suing the SW-DP an initialization sequence must be
performed to establish communication and bring the SW-DP to a know state.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l4 level1 lfo8; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Send more than 50 SWCLKTCK cycles with SWDIOTMS=1. This ensures
that both SWD and JTAG are in their reset states.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l4 level1 lfo8; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Send the 16-bit JTAG-to-SWD select sequence on SWDIOTMS<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l4 level1 lfo8; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Send more than 50 SWCLKTCK cycles with SWDIOTMS=1. This ensures
that if SWJ-DP was already in SWD mode, before sending the select sequence, the
SWD goes to line reset.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l4 level1 lfo8; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Perform a READID to validate that SWJ-DP has switched to SWD
operation.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="72-halt-the-core"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">7.2. Halt the core<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Before programming internal SRAM, the ARM Cortex M3 should first
be reset and halted. It gets the core and peripherals into a know state and
prohibit the core from accidentally running partial code while writing the
program.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">There debug and system registers and one Silabs extent AP
register CHIPAP_CTRL1 are used for this purpose. CHIPAP_CTRL1 address = 0x1,
APSEL = 0x0A. bit 3 core_reset_ap, To hold the CortexM3 core in reset this bit
should be written to one.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">The process is as follow:<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l7 level1 lfo9; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write 0x08 to CHIPAP_CTRL1.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l7 level1 lfo9; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write 0xA05F0001 to DHCSR, which halting debug enabled.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l7 level1 lfo9; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write 0x01 to DEMCR. This enable Reset Vector Catch.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l7 level1 lfo9; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write 0xFA050004 to AIRCR. This reset the core.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l7 level1 lfo9; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write 0x00 to CHIPAP_CTRL1.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Now the core will be halted on first instruction and all
peripherals and registers will have their reset value.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="73-memory-and-core-register-access"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">7.3. Memory and core register access.<o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="731-access-memory"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">7.3.1 Access memory<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l13 level1 lfo10; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Set 32 bit width and auto increment in CSW register.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l13 level1 lfo10; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write memory address in TAR register<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l13 level1 lfo10; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Access DRW register for read/write data.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Here is the python script example<o:p></o:p></span></div>
<div style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-element: para-border-div; padding: 5.0pt 8.0pt 5.0pt 8.0pt;">
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<b><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">def</span></b><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><b><span lang="EN-SG" style="color: #990000; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">swd_write_mem</span></b><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">(uda, address, data_ws, length):<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><i><span lang="EN-SG" style="color: #999988; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"># Auto increment addresses</span></i><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(DP_SELECT,
MEMAP_BANK_0)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_CSW,
</span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0x23000012</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_TAR,
address)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> <b>for</b> x <b>in</b>
</span><span lang="EN-SG" style="color: #0086b3; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">range</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> (</span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">, length):<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_DRW,
data_ws[x])<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>StartTransfers()<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<b><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">def</span></b><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><b><span lang="EN-SG" style="color: #990000; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">swd_read_mem</span></b><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">(uda, address, length):<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> data_ws <b>=</b> []<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><i><span lang="EN-SG" style="color: #999988; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"># Auto increment addresses</span></i><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(DP_SELECT,
MEMAP_BANK_0)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_CSW,
</span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0x23000012</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_TAR,
address)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> <b>for</b> x <b>in</b>
</span><span lang="EN-SG" style="color: #0086b3; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">range</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> (</span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">, length):<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueRead(MEMAP_DRW)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> data_ws<b>.</b>append(uda<b>.</b>StartTransfers()[</span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">])<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> <b>return</b> data_ws<o:p></o:p></span></div>
</div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="732-access-core-registers"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">7.3.2 Access core registers<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Read:</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l5 level1 lfo11; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Set 32 bit width in CSW register<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l5 level1 lfo11; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write DCRSR address into TAR register.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l5 level1 lfo11; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write core register index Rn into DRW register.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l5 level1 lfo11; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write DCRDR address into TAR register.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l5 level1 lfo11; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Read core register value from DRW register.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write:</span></b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l10 level1 lfo12; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Set 32 bit width in CSW register<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l10 level1 lfo12; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write DCRDR address into TAR register.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l10 level1 lfo12; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write core value into DRW register.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l10 level1 lfo12; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write DCRSR address into TAR register.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l10 level1 lfo12; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write core register index Rn and REGWnR = 1 into DRW register.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Here is the python script example<o:p></o:p></span></div>
<div style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-element: para-border-div; padding: 5.0pt 8.0pt 5.0pt 8.0pt;">
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<b><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">def</span></b><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><b><span lang="EN-SG" style="color: #990000; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">swd_write_core_register</span></b><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">(uda, n, val):<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(DP_SELECT,
MEMAP_BANK_0)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_CSW,
</span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0x23000002</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_TAR,
DCRDR)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_DRW,
val)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>StartTransfers()<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_TAR,
DCRSR)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_DRW,
n <b>|</b> (</span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">1</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> <b><<</b> </span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">16</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">))<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>StartTransfers()<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<b><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">def</span></b><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><b><span lang="EN-SG" style="color: #990000; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">swd_read_core_register</span></b><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">(uda, n):<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(DP_SELECT,
MEMAP_BANK_0)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_CSW,
</span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0x23000002</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_TAR,
DCRSR)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_DRW,
n)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>StartTransfers()<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueWrite(MEMAP_TAR,
DCRDR)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> uda<b>.</b>QueueRead(MEMAP_DRW)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> val <b>=</b> uda<b>.</b>StartTransfers()[</span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">]<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> <b>return</b> val<o:p></o:p></span></div>
</div>
<div class="MsoNormal" style="margin: 12pt 0in 11.25pt;">
<a href="https://draft.blogger.com/null" name="733-programming-firmware-into-internal-s"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">7.3.3 Programming firmware into internal SRAM<o:p></o:p></span></b></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">The process is followed<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l8 level1 lfo13; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Read firmware from disk.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l8 level1 lfo13; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Write firmware into internal SRAM by swd_write_mem() function.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l8 level1 lfo13; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Read back firmware by swd_read_mem() to verify the integrity.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l8 level1 lfo13; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Update vector table entry in 0xe000ed08 to SRAM start position 0x20000000.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l8 level1 lfo13; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Update R15(PC) with reset vector address. It locates at second
word position in firmware.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l8 level1 lfo13; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Update R13(SP) with stack address defined in first word in
firmware.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l8 level1 lfo13; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Exist debug mode by writing 0xA05F0000 into DHCSR register.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Here is the python script example<o:p></o:p></span></div>
<div style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-element: para-border-div; padding: 5.0pt 8.0pt 5.0pt 8.0pt;">
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> f <b>=</b> </span><span lang="EN-SG" style="color: #0086b3; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">open</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">(</span><span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">"sim3u1xx_USBHID_ram.bin"</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">,mode <b>=</b> </span><span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">'rb'</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> data <b>=</b> f<b>.</b>read()<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> swd_write_mem(uda, </span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0x20000000</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">, data, </span><span lang="EN-SG" style="color: #0086b3; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">len</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> <b>.</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> <b>.</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> <b>.</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> swd_write_mem(uda, </span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0xe000ed08</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">, </span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0x20000000</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">, </span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">1</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">
swd_write_core_register(uda, </span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">15</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">, data[</span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">1</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">]<b>&</b> </span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0xFFFFFFFE</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">
swd_write_core_register(uda, </span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">13</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">, data[</span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">])<o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 14.25pt; margin: 11.25pt 0in; padding: 0in;">
<span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> write_AHB(uda, DHCSR, </span><span lang="EN-SG" style="color: #009999; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">0xA05F0000</span><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">)<o:p></o:p></span></div>
</div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Then we can see firmware runs from internal SRAM.<o:p></o:p></span></div>
<div style="border-bottom: solid #EEEEEE 1.0pt; border: none; mso-border-bottom-alt: solid #EEEEEE .75pt; mso-element: para-border-div; padding: 0in 0in 0in 0in;">
<div class="MsoNormal" style="border: none; margin: 12pt 0in 11.25pt; padding: 0in;">
<a href="https://draft.blogger.com/null" name="8-source-code"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 24.0pt; mso-fareast-font-family: "Times New Roman";">8.
Source code<o:p></o:p></span></b></div>
</div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Source code can be found at </span><span lang="EN-SG"><a href="https://github.com/MarkDing/swd_programing_sram"><span style="color: #4183c4; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">https://github.com/MarkDing/swd_programing_sram</span></a></span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div style="border-bottom: solid #EEEEEE 1.0pt; border: none; mso-border-bottom-alt: solid #EEEEEE .75pt; mso-element: para-border-div; padding: 0in 0in 0in 0in;">
<div class="MsoNormal" style="border: none; margin: 12pt 0in 11.25pt; padding: 0in;">
<a href="https://draft.blogger.com/null" name="9-reference"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 24.0pt; mso-fareast-font-family: "Times New Roman";">9.
Reference<o:p></o:p></span></b></div>
</div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l11 level1 lfo14; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">Adi5</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> ARM Debug Interface v5 Architecture Specification.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l11 level1 lfo14; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">Adi51</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> ARM Debug Interface v5 Architecture Specification ADIv5.1
Supplement.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l11 level1 lfo14; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">Cm3trm</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> Cortex-M3 Revision r2p1 Technical Reference Manual<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l11 level1 lfo14; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">ARMv7-M</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> ARMv7-M Architecture Reference Manual<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-left: 0in; mso-list: l11 level1 lfo14; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span lang="EN-SG" style="color: #333333; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 11.5pt; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-SG" style="background: #F8F8F8; border: solid #DDDDDD 1.0pt; color: #333333; font-family: Consolas; font-size: 9.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-fareast-font-family: "Times New Roman"; padding: 0in;">CoreSight DAP-Lite</span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";"> CoreSight DAP-Lite Technical Reference Manual<o:p></o:p></span></div>
<div style="border-bottom: solid #EEEEEE 1.0pt; border: none; mso-border-bottom-alt: solid #EEEEEE .75pt; mso-element: para-border-div; padding: 0in 0in 0in 0in;">
<div class="MsoNormal" style="border: none; margin: 12pt 0in 11.25pt; padding: 0in;">
<a href="https://draft.blogger.com/null" name="license"></a><b><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 24.0pt; mso-fareast-font-family: "Times New Roman";">LICENSE<o:p></o:p></span></b></div>
</div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">The MIT License (MIT)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Copyright (c) 2014 Mark Ding(</span><span lang="EN-SG"><a href="mailto:mark.ding@hotmail.com"><span style="color: #4183c4; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">mark.ding@hotmail.com</span></a></span><span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute,
sub-license, and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-bottom: 11.25pt; margin-left: 0in; margin-right: 0in; margin-top: 11.25pt;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 19.15pt; margin-top: 11.25pt; mso-margin-bottom-alt: auto;">
<span lang="EN-SG" style="color: #333333; font-family: "Helvetica","sans-serif"; font-size: 11.5pt; mso-fareast-font-family: "Times New Roman";">THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<br /></div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com1tag:blogger.com,1999:blog-6138180379582869534.post-83642408870306807822014-01-02T02:08:00.002-08:002014-01-02T02:08:59.196-08:00Setup personal blog on Github page with Jekyll<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">1. Install Ruby 2.0.0</span><br />
<a class="ot-anchor aaTEdf" href="http://rubyforge.org/frs/download.php/76955/rubyinstaller-2.0.0-p195.exe" rel="nofollow" style="-webkit-transition: color 0.218s; background-color: white; color: #427fed; cursor: pointer; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; transition: color 0.218s;" target="_blank">http://rubyforge.org/frs/download.php/76955/rubyinstaller-2.0.0-p195.exe</a><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">2. Install Ruby DevKit for Ruby 2.0.0</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">Download it from</span><a class="ot-anchor aaTEdf" href="http://rubyforge.org/frs/download.php/76805/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe" rel="nofollow" style="-webkit-transition: color 0.218s; background-color: white; color: #427fed; cursor: pointer; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; transition: color 0.218s;" target="_blank">http://rubyforge.org/frs/download.php/76805/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe</a><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">Extract it to C:\devkit, enter the directory and execute below commands.</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">$ ruby dk.rb init </span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">to generate the config.yml file to be used later in this Step</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">$ ruby dk.rb install</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">This step installs (or updates) an operating_system.rb file into the relevant directory needed to implement a RubyGems</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">3. Add Taobao ruby in gem mirror list. This is because GFW blocking.</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">$ gem sources --remove </span><a class="ot-anchor aaTEdf" href="http://gemcutter.org/" rel="nofollow" style="-webkit-transition: color 0.218s; background-color: white; color: #427fed; cursor: pointer; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; transition: color 0.218s;" target="_blank">http://gemcutter.org/</a><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">$ gem sources --remove </span><a class="ot-anchor aaTEdf" href="http://rubygems.org/" rel="nofollow" style="-webkit-transition: color 0.218s; background-color: white; color: #427fed; cursor: pointer; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; transition: color 0.218s;" target="_blank">http://rubygems.org/</a><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">$ gem sources -a </span><a class="ot-anchor aaTEdf" href="http://ruby.taobao.org/" rel="nofollow" style="-webkit-transition: color 0.218s; background-color: white; color: #427fed; cursor: pointer; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; transition: color 0.218s;" target="_blank">http://ruby.taobao.org/</a><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">4. Install jekyll </span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">$ gem install github-pages</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">5. Clone Jekyll bootstrap</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">$ git clone </span><a class="ot-anchor aaTEdf" href="https://github.com/plusjade/jekyll-bootstrap.git" rel="nofollow" style="-webkit-transition: color 0.218s; background-color: white; color: #427fed; cursor: pointer; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; transition: color 0.218s;" target="_blank">https://github.com/plusjade/jekyll-bootstrap.git</a><span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;"></span><a class="ot-anchor aaTEdf" href="http://username.github.io/" rel="nofollow" style="-webkit-transition: color 0.218s; background-color: white; color: #427fed; cursor: pointer; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; transition: color 0.218s;" target="_blank">USERNAME.github.io</a><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">In </span><a class="ot-anchor aaTEdf" href="http://username.github.io/" rel="nofollow" style="-webkit-transition: color 0.218s; background-color: white; color: #427fed; cursor: pointer; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; transition: color 0.218s;" target="_blank">USERNAME.github.io</a><span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">, open _config.yml file, add </span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">markdown: redcarpet or markdown: rdiscount under line pygments: true.</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">The reason is to support Github flavored markdown. </span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">6. Start Jekyll</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">cd </span><a class="ot-anchor aaTEdf" href="http://usrername.github.io/" rel="nofollow" style="-webkit-transition: color 0.218s; background-color: white; color: #427fed; cursor: pointer; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; transition: color 0.218s;" target="_blank">USRERNAME.github.io</a><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">jekyll serve</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">We can see our first blog from </span><a class="ot-anchor aaTEdf" href="http://localhost:4000/" rel="nofollow" style="-webkit-transition: color 0.218s; background-color: white; color: #427fed; cursor: pointer; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; transition: color 0.218s;" target="_blank">http://localhost:4000</a><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">Press ctrl+c to exit local Jekyll.</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">Run </span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">Rake post title="Hello World"</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">And then we can see a .md file under directory _posts, excute Jekyll serve again, we can see the new post we have done. </span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">7. Push to Github</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">$ cd </span><a class="ot-anchor aaTEdf" href="http://username.github.io/" rel="nofollow" style="-webkit-transition: color 0.218s; background-color: white; color: #427fed; cursor: pointer; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; transition: color 0.218s;" target="_blank">USERNAME.github.io</a><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">$ git remote set-url origin git@github.com:USERNAME/USERNAME.github.io.git</span><br />
<span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;">$ git push</span><br />
<br style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;" />
Here is the new blog entry.<br />
<a class="ot-anchor aaTEdf" href="http://markding.github.io/" rel="nofollow" style="-webkit-transition: color 0.218s; background-color: white; color: #427fed; cursor: pointer; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; transition: color 0.218s;" target="_blank">http://markding.github.io/</a><span style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18px;"></span>Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-30776307712164867822013-12-05T23:29:00.003-08:002013-12-10T03:18:00.403-08:00HTML 5 desktop application for embedded system <div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<br /></div>
<h1 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 16pt; font-weight: normal; line-height: 22px; margin: 12pt 0in 0.0001pt; page-break-after: avoid;">
Introduction<o:p></o:p></h1>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
In embedded system design, we need to design desktop application to communicate with embedded devices. It is normally written by C++, C#, or TCL. And it is limited with OS environment. Developer needs to design different software version for Windows, Mac OS and Linux. For those cross platform requirement, we have better solution on it. Browser is common thing on various OS, just follow the HTML5 standard. Design a desktop application with HTML5, we can achieve the cross platform target, it can runs on Windows, Linux and Mac. The programing languages are HTML5, JavaScript and CSS. In the below section, we will investigate it in detail on how to design a HTML5 desktop application in embedded system design.<o:p></o:p></div>
<h1 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 16pt; font-weight: normal; line-height: 22px; margin: 12pt 0in 0.0001pt; page-break-after: avoid;">
Sublime Text 2<o:p></o:p></h1>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt; text-indent: 9.75pt;">
Sublime is wonderful text editor which support multi-platform. It is recommended to install it before we start looking into HTML5 things.<o:p></o:p></div>
<div class="MsoListParagraphCxSpFirst" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 27.75pt; text-indent: -0.25in;">
1.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span>Install the Sublime Text 2<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 27.75pt;">
Go to <span lang="EN-SG"><a href="http://www.sublimetext.com/2" style="color: #954f72;">http://www.sublimetext.com/2</a>, download Sublime Text 2 according your OS environment.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 63.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">OS X (OS X 10.6 or later is required)</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 63.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Windows - also available as a portable version</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 63.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Windows 64 bit - also available as a portable version</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 63.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Linux 32 bit</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 63.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Linux 64 bit</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 27.75pt; text-indent: -0.25in;">
2.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span><span lang="EN-SG">Install package control</span><o:p></o:p></div>
<div class="MsoListParagraphCxSpLast" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 27.75pt;">
<span lang="EN-SG">This helps us easier to install other plugin. Press CTRL+ ~ to console displayed, past below scripts in console and press ENTER.</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 12pt; margin-right: 12pt; padding: 6pt 10pt;">
<div class="MsoNormal" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())<o:p></o:p></span></div>
</div>
<div class="MsoListParagraphCxSpFirst" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 27.75pt;">
<span lang="EN-SG">Once installation completed, restart Sublime Text2, we will see Package Control in Preference -> Package Settings.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 27.75pt; text-indent: -0.25in;">
<span lang="EN-SG">3.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Plugin install</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">jsFormat</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 45.75pt;">
<span lang="EN-SG">Sometimes we got JavaScript code which has been compressed. Like below.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=6138180379582869534" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSw-6Lx619fgmYQW4zUfTCrRMZEbJlG2qhS18RY3bTh1C2uFPRUi9eTZLsAzLlV_PJCGOOl6no6eFkf1j_Z4wUxJQkdTKj1DB9P3XOp84DyOV_AIbJ8O2ZM9N1fI0AhxihEDTfpIbO5NeH/s1600/image001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSw-6Lx619fgmYQW4zUfTCrRMZEbJlG2qhS18RY3bTh1C2uFPRUi9eTZLsAzLlV_PJCGOOl6no6eFkf1j_Z4wUxJQkdTKj1DB9P3XOp84DyOV_AIbJ8O2ZM9N1fI0AhxihEDTfpIbO5NeH/s1600/image001.png" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 45.75pt;">
</div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 45.75pt;">
<span lang="EN-SG">It is no convenient to understand the code, press CTRL+ALT+F, the code has been formatted with beautiful form.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMWTfF3Rt1cYcdBvEeZzpCZMdQE_IDCPXYR1xWTm_dz_186dMz94jmUgHuzXM1fulpCVlFwwowSDCYO_OvcQkKKhfYAlwLekZ8qfDqkkxF-XOKbr3rldOLEwkD7gRVyTw-mAXc11RmzznL/s1600/image002.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMWTfF3Rt1cYcdBvEeZzpCZMdQE_IDCPXYR1xWTm_dz_186dMz94jmUgHuzXM1fulpCVlFwwowSDCYO_OvcQkKKhfYAlwLekZ8qfDqkkxF-XOKbr3rldOLEwkD7gRVyTw-mAXc11RmzznL/s1600/image002.png" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 45.75pt;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">DocBlockr</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 45.75pt;">
<span lang="EN-SG">Type /** and press enter, it will automatically generate doxygen compatible function description.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdHRLcSr19dt76veJS7YV8zcCWUy_fErC-SxS8YVazBvL4KScSwxm47KoQZJv_NBDFdBjutRpMK6IbWwN3XNVz7lp0Z57O1qHCnqpRY91Kj64DIJtigF_g4V9sQTR6-TNTiQfdH_wmaye7/s1600/image003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdHRLcSr19dt76veJS7YV8zcCWUy_fErC-SxS8YVazBvL4KScSwxm47KoQZJv_NBDFdBjutRpMK6IbWwN3XNVz7lp0Z57O1qHCnqpRY91Kj64DIJtigF_g4V9sQTR6-TNTiQfdH_wmaye7/s1600/image003.png" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 45.75pt;">
<a href="http://www.blogger.com/blogger.g?blogID=6138180379582869534" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">SublimeLinter</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 45.75pt;">
<span lang="EN-SG">Automatically check programming language grammar error. Below example shows missing semicolon case, it shows a red exclamation mark on left of the line. And display the error information in status bar at bottom of the window.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS8eoni6UUuHyV-n1zD7PEPhFN-htGv99uiHpoJ0YjQojenHEwZ8a0U4f8UJ25LzlouTuK6JyZqtHtp5heMiUg3r-RZAY2I5Gk0FxJyDZTRHZ67dr_cln7Q2Zx-1k1CSJ3yJMGkYM9hf6w/s1600/image004.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS8eoni6UUuHyV-n1zD7PEPhFN-htGv99uiHpoJ0YjQojenHEwZ8a0U4f8UJ25LzlouTuK6JyZqtHtp5heMiUg3r-RZAY2I5Gk0FxJyDZTRHZ67dr_cln7Q2Zx-1k1CSJ3yJMGkYM9hf6w/s1600/image004.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_JmDXV-nwPNoRVbIFLEjHK6GuQ1vEBJPxa5Xd54WH2vMDuy2LzKvMu8P7EOxUgmLSDElN-F_SjNg4_z0X97rf7AnOB9hh3pmPl3XIQOk3_adeUleaeR2WwhVchPlsiYfkIerY2zYIkWVC/s1600/image005.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_JmDXV-nwPNoRVbIFLEjHK6GuQ1vEBJPxa5Xd54WH2vMDuy2LzKvMu8P7EOxUgmLSDElN-F_SjNg4_z0X97rf7AnOB9hh3pmPl3XIQOk3_adeUleaeR2WwhVchPlsiYfkIerY2zYIkWVC/s1600/image005.png" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 45.75pt;">
<br /></div>
<div class="MsoListParagraphCxSpLast" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 45.75pt;">
<span style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 16pt; line-height: 22px;">HTML5</span></div>
<h1 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 16pt; font-weight: normal; line-height: 22px; margin: 12pt 0in 0.0001pt; page-break-after: avoid;">
<o:p></o:p></h1>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkLdbNBmZM8-asCCSQlUbOUmVyM-R9y3oD32NgXsxFVYrDIjWHwsHP6X2TqjwXN6zCqwSiANXHRah5Kt2ufuaJ6x3FFfXNnBUD216sV-DZyTd8CPboiuLxKpGz52wKvJk2dZShV7taXD-n/s1600/image006.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkLdbNBmZM8-asCCSQlUbOUmVyM-R9y3oD32NgXsxFVYrDIjWHwsHP6X2TqjwXN6zCqwSiANXHRah5Kt2ufuaJ6x3FFfXNnBUD216sV-DZyTd8CPboiuLxKpGz52wKvJk2dZShV7taXD-n/s200/image006.png" width="200" /></a></div>
<h1 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 16pt; font-weight: normal; line-height: 22px; margin: 12pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG"><a href="http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg" style="color: #954f72;"><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: #0b0080; font-family: Arial, sans-serif; font-size: 10pt; line-height: 13px; text-decoration: none;"></span></a></span><span style="color: windowtext; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px;"><o:p></o:p></span></h1>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
Introduction<o:p></o:p></h2>
<h1 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 16pt; font-weight: normal; line-height: 22px; margin: 12pt 0in 0.0001pt; page-break-after: avoid;">
<span style="color: windowtext; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px;">HTML5 is a markup language used for structuring and presenting content for the World Wide Web and a core technology of the Internet. It is the fifth revision of the HTML standard.<o:p></o:p></span></h1>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<br /></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">In addition to specifying markup, HTML5 specifies scripting application programming Interfaces (APIs) that can be used with JavaScript. Existing document object model (DOM) interfaces are extended and <i>de facto</i> features documented. There are also new APIs, such as:</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">HTML5 related APIs.</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">The canvas element for immediate mode 2D drawing. See Canvas 2D API Specification 1.0 specification</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Timed media playback</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Offline Web Applications</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Document editing</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Drag-and-drop</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Cross-document messaging</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Browser history management</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">MIME type and protocol handler registration</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Microdata</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 45.75pt; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Web Storage, a key-value pair storage framework that provides behaviour similar to cookies but with larger storage capacity and improved API.</span></div>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG"> </span></h2>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">Useful stuffs</span></h2>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.25in;">
<span lang="EN-SG"><a href="http://diveintohtml5.info/canvas.html" style="color: #954f72;">http://diveintohtml5.info/canvas.html</a></span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.25in;">
<span lang="EN-SG"><a href="http://www.w3schools.com/html/html5_intro.asp" style="color: #954f72;">http://www.w3schools.com/html/html5_intro.asp</a></span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<br /></div>
<h1 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 16pt; font-weight: normal; line-height: 22px; margin: 12pt 0in 0.0001pt; page-break-after: avoid;">
JavaScript<o:p></o:p></h1>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWLUQWmSXau0-DLaaIoYXccwb7xfDMhgT5rF5x9G1gKZWCCciws8wnLwwJ3WOPTzibQZQN7m82mlGvjrH0TKEFInmUvZDm9i9MEunAfTDGpf5VcmNG2UmHjaKDS0roPKGl6UnAe2FbXb3I/s1600/image008.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWLUQWmSXau0-DLaaIoYXccwb7xfDMhgT5rF5x9G1gKZWCCciws8wnLwwJ3WOPTzibQZQN7m82mlGvjrH0TKEFInmUvZDm9i9MEunAfTDGpf5VcmNG2UmHjaKDS0roPKGl6UnAe2FbXb3I/s200/image008.png" width="200" /></a></div>
<br />
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
Introduction<o:p></o:p></h2>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">JavaScript (JS) is an interpreted computer programming language. As part of web browsers, implementations allow client-side scripts to interact with the user, control the browser, communicate asynchronously, and alter the document content that is displayed. It has also become common in server-side programming, game development and the creation of desktop applications.</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">JavaScript is a prototype-based scripting language with dynamic typing and has first-class functions. Its syntax was influenced by C. JavaScript copies many names and naming conventions from Java, but the two languages are otherwise unrelated and have very different semantics. The key design principles within JavaScript are taken from the Self and Scheme programming languages. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles.</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
JavaScript was originally developed by Brendan Eich in <span lang="EN-SG" style="background-color: white; font-family: Arial, sans-serif; font-size: 10pt; line-height: 13px;">Netscape</span>.<o:p></o:p></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
Although it was developed under the name Mocha, the language was officially called LiveScript when it first shipped in beta releases of Netscape Navigator 2.0 in September 1995, but it was renamed JavaScript when it was deployed in the Netscape browser version 2.0B3.<o:p></o:p></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
The change of name from LiveScript to JavaScript roughly coincided with Netscape adding support for Java technology in its Netscape Navigator web browser. The final choice of name caused confusion, giving the impression that the language was a spin-off of the Java programming language, and the choice has been characterized by many as a marketing ploy by Netscape to give JavaScript the cachet of what was then the hot new web programming language.<o:p></o:p></div>
<h1 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 16pt; font-weight: normal; line-height: 22px; margin: 12pt 0in 0.0001pt; page-break-after: avoid;">
<o:p> </o:p></h1>
<h1 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 16pt; font-weight: normal; line-height: 22px; margin: 12pt 0in 0.0001pt; page-break-after: avoid;">
Node.js<o:p></o:p></h1>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiavYecyDuUTKxS6ifoWyjCd8xfEulIT0Y8IWN2Z1ft63s_EG-JXbf0CEYPLm4RK-jTcEuawneh0d7GDZ4xlnoWNFWSzBD_PaFp7YIf15k_vUkVGUvF-8uya7Aqa_B7MaV7KQXLJ_FPCCBe/s1600/image010.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiavYecyDuUTKxS6ifoWyjCd8xfEulIT0Y8IWN2Z1ft63s_EG-JXbf0CEYPLm4RK-jTcEuawneh0d7GDZ4xlnoWNFWSzBD_PaFp7YIf15k_vUkVGUvF-8uya7Aqa_B7MaV7KQXLJ_FPCCBe/s1600/image010.png" /></a></div>
<br />
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
Introduction<o:p></o:p></h2>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">Node.js is a software platform that is used to build scalable network (especially server-side) applications. Node.js utilizes JavaScript as its scripting language, and achieves high throughput via non-blocking I/O and a single-threaded event loop.</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">Node.js contains a built-in HTTP server library, making it possible to run a web server without the use of external software, such as Apache or Lighttpd, and allowing more control of how the web server works.</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">Node.js was created by Ryan Dahl starting in 2009. Its development and maintenance is sponsored by Joyent.</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">Node.js is a packaged compilation of Google's V8 JavaScript engine, the platform abstraction layer, and a core library, which is itself primarily written in JavaScript.</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">Dahl's original goal was to create web sites with push capabilities as seen in web applications like Gmail. After trying solutions in several other programming languages he chose JavaScript because of the lack of an existing I/O API. This allowed him to define a convention of non-blocking, event-driven I/O.</span></div>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">Useful stuffs</span></h2>
<div class="MsoListParagraphCxSpFirst" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Download Node.js from <a href="http://nodejs.org/" style="color: #954f72;">http://nodejs.org/</a></span></div>
<div class="MsoListParagraphCxSpLast" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.5in;">
<span lang="EN-SG">It support Windows, Macintosh and Lnux</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo7FbYfnyJTqnFl2sT_igvA06LRxgiYHm1Ie_dM0HHMWs6H88-zrDVS6_qqCO7B3GwFOZTIoNkRHn-1XSZRYx5XVgg1tZftmRaXLjJ19bG9_oOSQma03PrkwGH4qECjExSxl4SV94AGNla/s1600/image011.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo7FbYfnyJTqnFl2sT_igvA06LRxgiYHm1Ie_dM0HHMWs6H88-zrDVS6_qqCO7B3GwFOZTIoNkRHn-1XSZRYx5XVgg1tZftmRaXLjJ19bG9_oOSQma03PrkwGH4qECjExSxl4SV94AGNla/s1600/image011.png" /></a></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
</div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">Node.js is released under the MIT license, and bundles other liberally licensed OSS components.</span></div>
<div class="MsoListParagraph" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">A good place to study node.js, <a href="http://www.nodebeginner.org/" style="color: #954f72;">http://www.nodebeginner.org/</a></span></div>
<h1 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 16pt; font-weight: normal; line-height: 22px; margin: 12pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">Webkit</span></h1>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_vDEbuIzLcYiAi5x2sKcf2N5mpwLiEAc7FfS79DaUlPm66eoWt82jjQybJqmMIgDdreb96P7V54xdCyFNJ-zKkLZ_hrXamLCNm2Sz67laQpL5XO9JSr8XXEYU6S1vK_0MyhJCUdGGR5m_/s1600/image012.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_vDEbuIzLcYiAi5x2sKcf2N5mpwLiEAc7FfS79DaUlPm66eoWt82jjQybJqmMIgDdreb96P7V54xdCyFNJ-zKkLZ_hrXamLCNm2Sz67laQpL5XO9JSr8XXEYU6S1vK_0MyhJCUdGGR5m_/s1600/image012.png" /></a></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<br /></div>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
Introduction<o:p></o:p></h2>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
WebKit is a layout engine software component designed to allow web browsers to render web pages. WebKit is used as the rendering engine within Safari and was formerly used by Google's Chrome web browser on Windows, OS X, iOS and Android (however, Chrome only used WebCore, and also incorporated its own JavaScript engine and multi-process system). Other applications on OS X make use of WebKit, such as Apple's e-mail client Mail and the 2008 version of Microsoft's Entourage personal information manager, both of which make use of WebKit to render e-mail messages with HTML content.<o:p></o:p></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG"><a href="http://www.webkit.org/" style="color: #954f72;">http://www.webkit.org/</a></span><o:p></o:p></div>
<h1 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 16pt; font-weight: normal; line-height: 22px; margin: 12pt 0in 0.0001pt; page-break-after: avoid;">
Node-webkit<o:p></o:p></h1>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
Introduction<o:p></o:p></h2>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
Node-webkit is an app runtime based on Chromium and node.js. You can write native apps in HTML and JavaScript with node-webkit. It also lets you call Node.js modules directly from the DOM and enables a new way of writing native applications with all Web technologies.<o:p></o:p></div>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">Features</span></h2>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Apps written in modern HTML5, CSS3, JS and WebGL.</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Complete support for Node.js APIs and all its third party modules.</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Good performance: Node and WebKit runs in the same thread: Function calls are made straightforward; objects are in the same heap and can just reference each other;</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Easy to package and distribute apps.</span></div>
<div class="MsoNoSpacing" style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span lang="EN-SG">Available on Linux, Mac OSX and Windows</span></div>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG"> </span></h2>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">Installation</span></h2>
<div class="MsoListParagraphCxSpFirst" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">1.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Download latest version from <a href="https://github.com/rogerwang/node-webkit" style="color: #954f72;">https://github.com/rogerwang/node-webkit</a></span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">2.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Extract the package and copy all files into directory C:\Program Files\node-webkit</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">3.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Configure build and debugging setting in Sublime Text2 for Node-webkit</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">Windows</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Select Tools->Build system->New Build System, it opens a new file named “untiled.sublime-build”.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=6138180379582869534" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<div class="MsoListParagraphCxSpLast" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 1in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Copy below code into untiled.sublime-build and save it as “Node-webkit.sublime-build”</span></div>
<div style="background-color: #f8f8f8; border: 1pt solid rgb(221, 221, 221); padding: 5pt 8pt;">
<pre style="border: none; font-family: 'Courier New'; font-size: 10pt; line-height: 14.25pt; margin: 0in 0in 0.0001pt; padding: 0in;"><code style="font-family: 'Courier New';"><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 9pt;">{<o:p></o:p></span></code></pre>
<pre style="border: none; font-family: 'Courier New'; font-size: 10pt; line-height: 14.25pt; margin: 0in 0in 0.0001pt; padding: 0in;"><code style="font-family: 'Courier New';"><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 9pt;"> "cmd": ["nw.exe", "--enable-logging", "${project_path:${file_path}}"],<o:p></o:p></span></code></pre>
<pre style="border: none; font-family: 'Courier New'; font-size: 10pt; line-height: 14.25pt; margin: 0in 0in 0.0001pt; padding: 0in;"><code style="font-family: 'Courier New';"><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 9pt;"> "working_dir": "${project_path:${file_path}}",<o:p></o:p></span></code></pre>
<pre style="border: none; font-family: 'Courier New'; font-size: 10pt; line-height: 14.25pt; margin: 0in 0in 0.0001pt; padding: 0in;"><code style="font-family: 'Courier New';"><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 9pt;"> "path": "C:/Program Files/node-webkit/"<o:p></o:p></span></code></pre>
<pre style="border: none; font-family: 'Courier New'; font-size: 10pt; line-height: 14.25pt; margin: 0in 0in 0.0001pt; padding: 0in;"><code style="font-family: 'Courier New';"><span lang="EN-SG" style="color: #333333; font-family: Consolas; font-size: 9pt;">}</span></code><span lang="EN-SG" style="color: #333333; font-family: Consolas;"><o:p></o:p></span></pre>
</div>
<div class="MsoListParagraphCxSpFirst" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Press Ctrl+B to build your project.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">Please find more information from official website. </span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG"><a href="https://github.com/rogerwang/node-webkit/wiki/Debugging-with-Sublime-Text-2" style="color: #954f72;">https://github.com/rogerwang/node-webkit/wiki/Debugging-with-Sublime-Text-2</a></span></div>
<div class="MsoListParagraphCxSpLast" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.5in;">
<br /></div>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
Desktop application example<o:p></o:p></h2>
<h3 style="color: #1f4d78; font-family: 'Calibri Light', sans-serif; font-size: 12pt; font-weight: normal; line-height: 17px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
Hello World example<o:p></o:p></h3>
<div class="MsoListParagraphCxSpFirst" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
1.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span>Create index.html<o:p></o:p><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiakCukTNrXp77YwxFwHzUcts4cdm73u0z7NXNberRindgxB9CHfPyvQz164KulgC58W5AWPFiPPcoH_5Pg2ncXMcWcpoK29_a8JgGnJDsGAu2S1AD2aJVLk4uuGGcvzcF57Esw9S2Cctj_/s1600/image013.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiakCukTNrXp77YwxFwHzUcts4cdm73u0z7NXNberRindgxB9CHfPyvQz164KulgC58W5AWPFiPPcoH_5Pg2ncXMcWcpoK29_a8JgGnJDsGAu2S1AD2aJVLk4uuGGcvzcF57Esw9S2Cctj_/s1600/image013.png" /></a></div>
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">2.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Create package.json</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 0.5in; margin-right: 12pt; padding: 6pt 10pt;">
<blockquote class="tr_bq">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">{</span><span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> </span><span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> "name": "nw-demo",</span><span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> "main": "index.html"</span><span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">}</span></blockquote>
</div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">3.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Run project by pressing Ctrl+B, it shows below window,</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9wEHnL3u_GXnzhUrs5Zb7Z9oN90UANmeUZx4ol7CNVD5v-UvR0qdOCvhItJoZDzY7PEGtbayFvNsycQyR98pE0sND19F73ajiNzvi9fW32j7y6SPJApcKKaWBHawtjXt4qZ18wU0B7heh/s1600/image013.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9wEHnL3u_GXnzhUrs5Zb7Z9oN90UANmeUZx4ol7CNVD5v-UvR0qdOCvhItJoZDzY7PEGtbayFvNsycQyR98pE0sND19F73ajiNzvi9fW32j7y6SPJApcKKaWBHawtjXt4qZ18wU0B7heh/s1600/image013.png" /></a></div>
<div class="MsoListParagraphCxSpLast" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.5in;">
<br /></div>
<h3 style="color: #1f4d78; font-family: 'Calibri Light', sans-serif; font-size: 12pt; font-weight: normal; line-height: 17px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">Official demo code</span></h3>
<div class="MsoListParagraph" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.5in;">
<span lang="EN-SG">There are several example codes in <a href="https://github.com/zcbenz/nw-sample-apps" style="color: #954f72;">https://github.com/zcbenz/nw-sample-apps</a></span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">Here is snap of one example code “menus”</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHDNHYrFf_lbj7oxFJY89Fz_8Pk_09c77rwVEZeeZmIb4skvwNYCA45YWpMR8VAR3QBuyBVr2yLLqa89HNYkX0JdkrxOaHdfVSHv9IAwbxLG8bKpSWI4H7ka5pdezVYqUVsAUIlhixzC4Z/s1600/image014.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHDNHYrFf_lbj7oxFJY89Fz_8Pk_09c77rwVEZeeZmIb4skvwNYCA45YWpMR8VAR3QBuyBVr2yLLqa89HNYkX0JdkrxOaHdfVSHv9IAwbxLG8bKpSWI4H7ka5pdezVYqUVsAUIlhixzC4Z/s1600/image014.png" /></a></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<br /></div>
<h1 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 16pt; font-weight: normal; line-height: 22px; margin: 12pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">Real Desktop application example</span></h1>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">Now we can start working on a real application examples. According the procedure, we can familiar with desktop application development with Node-webkit.</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">We have an F33x UART bootloader PC application, written by C#, the user interface shows below, let us make same one with HTML5 and JavaScript.</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">Get reference from</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG"><a href="http://www.silabs.com/Support%20Documents/TechnicalDocs/AN778.pdf" style="color: #954f72;">http://www.silabs.com/Support%20Documents/TechnicalDocs/AN778.pdf</a></span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG"><a href="http://www.silabs.com/Support%20Documents/Software/AN778SW.zip" style="color: #954f72;">http://www.silabs.com/Support%20Documents/Software/AN778SW.zip</a></span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8zglTyWfQrHi-6Gn69EHv9VY23mBsD9o4h1n98dx2K3TauXuDwguY6vLVJ1vqzqWNpnkBb9nzl8-5GemV1OvvnH0fUZFmsq5o1FI6XFcLTeR6X8SWn0-aMzSXhftaisaiLhKnnvEzwq_n/s1600/image015.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8zglTyWfQrHi-6Gn69EHv9VY23mBsD9o4h1n98dx2K3TauXuDwguY6vLVJ1vqzqWNpnkBb9nzl8-5GemV1OvvnH0fUZFmsq5o1FI6XFcLTeR6X8SWn0-aMzSXhftaisaiLhKnnvEzwq_n/s1600/image015.png" /></a></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<br /></div>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">UI implementation:</span></h2>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">There are four buttons, two check boxes, six drop down lists, one table, and one text area.</span></div>
<div class="MsoListParagraphCxSpFirst" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG">1.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Add drop down lists.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<span lang="EN-SG">Get reference from <a href="http://www.w3schools.com/tags/tag_select.asp" style="color: #954f72;">http://www.w3schools.com/tags/tag_select.asp</a>.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRl9aHrB-KNIxZWOyPexBnlPEsnPQgEY-uz4cRgbdQDI7itsLxnzp-s-GhlKc3qtmbCdhIC7yUtgvYjjhTeQ1faiK2NR1t3UbUO8zGmJe23HE-5g_KjvjuREVR8czwXkKoO4-cwDon20up/s1600/image017.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRl9aHrB-KNIxZWOyPexBnlPEsnPQgEY-uz4cRgbdQDI7itsLxnzp-s-GhlKc3qtmbCdhIC7yUtgvYjjhTeQ1faiK2NR1t3UbUO8zGmJe23HE-5g_KjvjuREVR8czwXkKoO4-cwDon20up/s1600/image017.png" /></a></div>
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<span lang="EN-SG">The effort shows close to C# appearance.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIY7kuKkJen6qwsfqKEOTp8DC1GUvW6yU4NnjYjErDEtzHMNVh0Qn8bBJFeRKmzbA4srI5P0-JWUQNquNfoNFjevBsJ92ptn3SVYdmfDoUQCgEpisM_NwWLlApGIUoRA08ydp3Z4tEzw_E/s1600/image016.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIY7kuKkJen6qwsfqKEOTp8DC1GUvW6yU4NnjYjErDEtzHMNVh0Qn8bBJFeRKmzbA4srI5P0-JWUQNquNfoNFjevBsJ92ptn3SVYdmfDoUQCgEpisM_NwWLlApGIUoRA08ydp3Z4tEzw_E/s1600/image016.png" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG">2.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Add button</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<span lang="EN-SG">Get reference from <a href="http://www.w3schools.com/tags/tag_button.asp" style="color: #954f72;">http://www.w3schools.com/tags/tag_button.asp</a></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFN6XTnaibutSmK9o9yz791h_ckLKE9KrOBemcHeiuj1r-PesA6ZrNeelt82COfr9_rZN2I2VGyqbbfmN0MsrlTRD-mQ_G5mtcLUXtEnLZRWMVUnXlm-Zsg_TDuwYq-iNCvXpCA7AI-mJH/s1600/image019.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFN6XTnaibutSmK9o9yz791h_ckLKE9KrOBemcHeiuj1r-PesA6ZrNeelt82COfr9_rZN2I2VGyqbbfmN0MsrlTRD-mQ_G5mtcLUXtEnLZRWMVUnXlm-Zsg_TDuwYq-iNCvXpCA7AI-mJH/s1600/image019.png" /></a></div>
<span style="font-size: 11pt;">The effort looks good.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZgaiENWgyJMMYBm1U0bCErmO2zCaoiwPWYIgYJNKTi_gzio5q4-EZiMLLd2rsPfCLM-MVX7eaG8Z1ApZRe1856an8vbs-eTTFDGhyphenhyphenDTYyqcQO37iA32p9FpiFc3N8vWYqljKWFG3OrDv0/s1600/image017.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZgaiENWgyJMMYBm1U0bCErmO2zCaoiwPWYIgYJNKTi_gzio5q4-EZiMLLd2rsPfCLM-MVX7eaG8Z1ApZRe1856an8vbs-eTTFDGhyphenhyphenDTYyqcQO37iA32p9FpiFc3N8vWYqljKWFG3OrDv0/s1600/image017.png" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG">3.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Add Tables</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<span lang="EN-SG">Get reference from <a href="http://www.w3schools.com/html/html_tables.asp" style="color: #954f72;">http://www.w3schools.com/html/html_tables.asp</a></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVo9qGxj7HvZRGRFVWqLXTcTvQUJ4g9Jw95pSTDDx4-G-5z0Ov63IRrjvHuoHFG_Mv0bk54MF_p0aIJFkXX7IrsF4m7gxMSnSOpy0Ul5B1FVYUiCh2iJHYgEmIE_pwy6IlZtxaYXjHATTK/s1600/image022.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVo9qGxj7HvZRGRFVWqLXTcTvQUJ4g9Jw95pSTDDx4-G-5z0Ov63IRrjvHuoHFG_Mv0bk54MF_p0aIJFkXX7IrsF4m7gxMSnSOpy0Ul5B1FVYUiCh2iJHYgEmIE_pwy6IlZtxaYXjHATTK/s1600/image022.png" /></a></div>
<span style="font-size: 11pt;">The effort looks good too.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_1EHJKGab4QCa6Z3X6ew83be_Ilev7xrm8aiZU8GkzTtlrwJWHGOpVlYqsYmjbjTW9OGn8EF-q32YxY5auB-biYvYEiP4ZAjWtCSWj26EPe6QSyeRGHtpnX7KGxjlPiKKdRg246LZLTLy/s1600/image019.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_1EHJKGab4QCa6Z3X6ew83be_Ilev7xrm8aiZU8GkzTtlrwJWHGOpVlYqsYmjbjTW9OGn8EF-q32YxY5auB-biYvYEiP4ZAjWtCSWj26EPe6QSyeRGHtpnX7KGxjlPiKKdRg246LZLTLy/s1600/image019.png" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG">4.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Checkbox</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<span lang="EN-SG">Get reference from <a href="http://www.w3schools.com/jsref/prop_checkbox_checked.asp" style="color: #954f72;">http://www.w3schools.com/jsref/prop_checkbox_checked.asp</a></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ05pg47Gp8acUE2H-HDvYhmaYzw1tO2DQTaF4Vjd71D69YU7dQAwYWAtBeZYL1pl5U47ibDyk1YjIJ0hBZPO2QfpF0E19xO4bjfTVuhjwNIClstS2e4uH7v1Cgi6mAFKHK-JdU2PihE2A/s1600/image024.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ05pg47Gp8acUE2H-HDvYhmaYzw1tO2DQTaF4Vjd71D69YU7dQAwYWAtBeZYL1pl5U47ibDyk1YjIJ0hBZPO2QfpF0E19xO4bjfTVuhjwNIClstS2e4uH7v1Cgi6mAFKHK-JdU2PihE2A/s1600/image024.png" /></a></div>
<span style="font-size: 11pt;">The effort looks good.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAFcqMcPGPsYcYsRywHXSC2_kcxmAZNBaNf2-pBo12IBMFkDguLn1PwCruQm-4Uk1p1I4zQWZBZqszyeR6h4wqiyYo9y_bQg8RmwXH0_ktqoN-byP6tc_DICytGcPX1vHDy7qfB3S3BCQr/s1600/image020.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAFcqMcPGPsYcYsRywHXSC2_kcxmAZNBaNf2-pBo12IBMFkDguLn1PwCruQm-4Uk1p1I4zQWZBZqszyeR6h4wqiyYo9y_bQg8RmwXH0_ktqoN-byP6tc_DICytGcPX1vHDy7qfB3S3BCQr/s1600/image020.png" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG">5.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Text area</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<span lang="EN-SG">Get reference from <a href="http://www.w3schools.com/tags/tag_textarea.asp" style="color: #954f72;">http://www.w3schools.com/tags/tag_textarea.asp</a></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDT7uHsWVtaaZVnbaTqXnfjzX-gYauGUB2oHp65CopT97ZJm87loXTWi0Kev9A0e4eKscIJOUD0BKXBc4xIaKQs3Lk6dDOsThs4n_jt_Na2GiadzIFVRS-u4IwAZXkfdZ4cLWtnN5XPMlf/s1600/image026.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDT7uHsWVtaaZVnbaTqXnfjzX-gYauGUB2oHp65CopT97ZJm87loXTWi0Kev9A0e4eKscIJOUD0BKXBc4xIaKQs3Lk6dDOsThs4n_jt_Na2GiadzIFVRS-u4IwAZXkfdZ4cLWtnN5XPMlf/s1600/image026.png" /></a></div>
<span style="font-size: 11pt;">The effort looks good too.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPeKFf_f3AWYV4JTymroF-J4XEc-swHuxZz8tyO8Ex84nsCM84SfiaOABVCpF4nykrT1ELAAqDNY87YqabfrVs_io2WCofnuum0pq2SNqwuq4wnvtRXgJmT8MhTilTjtJ57RKHMwfL1K8q/s1600/image021.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPeKFf_f3AWYV4JTymroF-J4XEc-swHuxZz8tyO8Ex84nsCM84SfiaOABVCpF4nykrT1ELAAqDNY87YqabfrVs_io2WCofnuum0pq2SNqwuq4wnvtRXgJmT8MhTilTjtJ57RKHMwfL1K8q/s1600/image021.png" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG">6.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Final display effort</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<span lang="EN-SG">Get reference from <a href="http://www.w3schools.com/html/html_examples.asp" style="color: #954f72;">http://www.w3schools.com/html/html_examples.asp</a></span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<span lang="EN-SG">After fine tune UI layout, the final appearance looks like below snapshot.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.blogger.com/blogger.g?blogID=6138180379582869534" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuPf4FNspZjgEKAS8nP8GgKV9mHNhb85GBWnN2lOhEpJj7c9b1axU-Ast_8qleujBYC-zapVk_2-VVVq-jIA3Kz2-Gmveauzl9KASxpF_ZVvVweHl5w5NeD_AEVbmXx6Mx49ARDeb0DOkS/s1600/image022.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuPf4FNspZjgEKAS8nP8GgKV9mHNhb85GBWnN2lOhEpJj7c9b1axU-Ast_8qleujBYC-zapVk_2-VVVq-jIA3Kz2-Gmveauzl9KASxpF_ZVvVweHl5w5NeD_AEVbmXx6Mx49ARDeb0DOkS/s1600/image022.png" /></a></div>
<div align="center" class="MsoListParagraphCxSpLast" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt; text-align: center;">
<br /></div>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">File system access</span></h2>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">We need open hex file from explorer window and read file contents.</span></div>
<div class="MsoListParagraphCxSpFirst" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">1.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Open file Dialog</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">Here we want click on button “Select Hex File(s)”, it should display file open dialog to select input file. Here we need start coding JavaScript to achieve file access function.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">Get reference from <a href="http://www.w3schools.com/jsref/dom_obj_fileupload.asp" style="color: #954f72;">http://www.w3schools.com/jsref/dom_obj_fileupload.asp</a></span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">In index.html,</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">Add input tag to for file upload, the id is “openFile”, the id can be access by JavaScript code. And set it not display style. Also add script tag to execute script.js.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI9aH3zZy_ofN8dq8zTkDngWGTSb8agi4nRvOoMnnLmahjmuB9nParnDaFaVvafTuJGMk__7JuHYz5NPR6kdHFC3HVt9kYLckeyKUezo_QA3Q5yiA1eMjiYszktNrfptJct6ItmBLpJjMq/s1600/image030.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI9aH3zZy_ofN8dq8zTkDngWGTSb8agi4nRvOoMnnLmahjmuB9nParnDaFaVvafTuJGMk__7JuHYz5NPR6kdHFC3HVt9kYLckeyKUezo_QA3Q5yiA1eMjiYszktNrfptJct6ItmBLpJjMq/s1600/image030.png" /></a></div>
<span style="font-size: 11pt;">And then change button tag of “Select Hex File(s)”, id is “openHexFile”, onClick event handler function is openFileOption().</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1Mmqhx2xh0SOAflFZwLpWbVaiFGafuz7Lb6c1v6QQv7pUqcmJOwO19h-ixlem3P-jr5sNmoDWIrwouV-aFBtwfVHSIa6QX41qJr3rEbs7j_Z_4dO_Q7xI_lx2DGnt9zo4e3uI3qYKhSae/s1600/image031.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1Mmqhx2xh0SOAflFZwLpWbVaiFGafuz7Lb6c1v6QQv7pUqcmJOwO19h-ixlem3P-jr5sNmoDWIrwouV-aFBtwfVHSIa6QX41qJr3rEbs7j_Z_4dO_Q7xI_lx2DGnt9zo4e3uI3qYKhSae/s1600/image031.png" /></a></div>
</div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">In script.js,</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">Add openFileOption(), notice getElementById() with id ‘openFile’, which defined in indel.html input TAG. And with onClick event of input tag, it call handleFiles, which print out selected file name on console.</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 0.5in; margin-right: 12pt; padding: 6pt 10pt;">
<blockquote class="tr_bq">
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">function openFileOption() {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> document.getElementById("openFile").click();<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">}<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">function handleFiles(files) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> for (var i = 0; i < files.length; ++i)<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> console.log(files[i].name);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">}</span></div>
</blockquote>
</div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Press Ctrl+B, click on button “Select Hex File(s)”, we can see a file dialog appeared.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ7a63ZSodhpudqggy5OLzPKzOxrQciSz_t2Koxa_cWjOmz2VBafPpoKAYh0HmFx_rD3xpfft2ue39fpiALHZzCAJiBvhH4P6uXw3X5NMLG6bZgEMp8wj4Fb8SZWXkQoCO-rfEno_8Izm9/s1600/image025.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ7a63ZSodhpudqggy5OLzPKzOxrQciSz_t2Koxa_cWjOmz2VBafPpoKAYh0HmFx_rD3xpfft2ue39fpiALHZzCAJiBvhH4P6uXw3X5NMLG6bZgEMp8wj4Fb8SZWXkQoCO-rfEno_8Izm9/s1600/image025.jpg" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div align="center" class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt; text-align: center;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">2.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Read file contents</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">Here we need node.js to access local storage file.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">Get reference from <a href="http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback" style="color: #954f72;">http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback</a></span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">In script.js</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 0.5in; margin-right: 12pt; padding: 6pt 10pt;">
<blockquote class="tr_bq">
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">var fs = require('fs');<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">function handleFiles(files) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> fs.readFile(files[0].name, 'utf8', function(err,data) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> if (err) throw err;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> console.log(data);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> });<o:p></o:p></span></div>
<span style="color: #dd1144; font-family: Consolas; font-size: 10.5pt; line-height: 13.5pt;">}</span></blockquote>
</div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">Press Ctrl+B, click on button ”Select Hex File(s)”, select Sample_User_Application.hex file, and then we can see Hex file contents output in console.</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 0.5in; margin-right: 12pt; padding: 6pt 10pt;">
<div class="MsoListParagraphCxSpLast" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">[3928:1120/153906:INFO:CONSOLE(6)] "":03040000020447AC\r\n:0C044700787FE4F6D8FD758107020433CD\r\n:1004330053D9BF1204037FB07E63120415D2AFE415\r\n:04044300F5A780FE9B\r\n:0D040300AFA775A70F75E24043AF048FA7A8\r\n:0104100022C9\r\n:10041500ADA775A70FE4F5C8C39FFFE49EF5CB8F85\r\n:0D042500CA74FFF5CDF5CCD2ADD2CA8DA7BB\r\n:0104320022A7\r\n:030412000204538E\r\n:05045300C2CFB2B2327D\r\n:0B77F500250101020136071BA5C23D63\r\n:00000001FF\r\n"",<o:p></o:p></span></div>
</div>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">Hex file analysis</span></h2>
<div class="MsoListParagraph" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">1.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Introduction</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">Intel HEX is a file format for conveying binary information for applications like programming microcontrollers, EPROMs, and other kinds of chips. The format is a text file, with each line containing hexadecimal values encoding a sequence of data and their starting offset or absolute address.</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">Each line of Intel HEX file consists of six parts:</span></div>
<div class="MsoListParagraphCxSpFirst" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><b><span lang="EN-SG">Start code</span></b><span lang="EN-SG">, one character, an ASCII colon ':'.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><b><span lang="EN-SG">Byte count</span></b><span lang="EN-SG">, two hex digits, a number of bytes (hex digit pairs) in the data field. 16 (0x10) or 32 (0x20) bytes of data are the usual compromise values between line length and address overhead.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><b><span lang="EN-SG">Address</span></b><span lang="EN-SG">, four hex digits, a 16-bit address of the beginning of the memory position for the data. Limited to 64 kilobytes, the limit is worked around by specifying higher bits via additional record types.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><b><span lang="EN-SG">Record type</span></b><span lang="EN-SG">, two hex digits, <i>00</i> to <i>05</i>, defining the type of the data field.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><b><span lang="EN-SG">Data</span></b><span lang="EN-SG">, a sequence of <i>n</i> bytes of the data themselves, represented by 2<i>n</i> hex digits.</span></div>
<div class="MsoListParagraphCxSpLast" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><b><span lang="EN-SG">Checksum</span></b><span lang="EN-SG">, two hex digits </span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG">Example of Hex file</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheNHqd33Dnh8CAnXyjD7Md7uwct8Cwt45H0_TIdhpHztbPoAI8LD3Spfy7xb6rcLgKGNw8CyT2ctscURSkhW8Hyi9rbZDeECgWm3wWluMeyC1lXmZkZJRUd_vVFub-OxTCogDvYVyldUce/s1600/image026.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheNHqd33Dnh8CAnXyjD7Md7uwct8Cwt45H0_TIdhpHztbPoAI8LD3Spfy7xb6rcLgKGNw8CyT2ctscURSkhW8Hyi9rbZDeECgWm3wWluMeyC1lXmZkZJRUd_vVFub-OxTCogDvYVyldUce/s1600/image026.png" /></a></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">2.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Hex parser coding</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">Get reference from <a href="https://github.com/bminer/intel-hex.js" style="color: #954f72;">https://github.com/bminer/intel-hex.js</a></span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><b><span lang="EN-SG">User firmware structure:<o:p></o:p></span></b></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">The user firmware application structure look like below. The user firmware start address from 0x400, and at end of user firmware area, there is application info block which record the user firmware information, something like App start Address, App End Address, BL type, etc.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr5d74XhCtfgPNyy5UVL3Pg3xxc-EAsROCHkF3w9b_xsSKc4lJNAAjDqLrCSw1tD9TeeAEIaswh3ZXQloIyXa0j76yWPO4ueHnhtdpBRacUdUnZ0NeBN_xtLZDfI6ZROgV5pYhxvQeretP/s1600/image028.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr5d74XhCtfgPNyy5UVL3Pg3xxc-EAsROCHkF3w9b_xsSKc4lJNAAjDqLrCSw1tD9TeeAEIaswh3ZXQloIyXa0j76yWPO4ueHnhtdpBRacUdUnZ0NeBN_xtLZDfI6ZROgV5pYhxvQeretP/s1600/image028.png" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">In our example, the user application firmware start address is 0x400, however, the application info block address at 0x77F5. That means two pages are needed for this firmware, and a lot of pages bare between first occurred page and last occurred page.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><b><span lang="EN-SG">Modification on Intel-hex.js:<o:p></o:p></span></b></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">The original hex parser JavaScript will fill 0xFF in page which is not used. In our case, it will generate a big image from address 0x0000 to 0x7800, which is too large for us. So an array flashPageInUse added in intel-hex.js to record which page is being used. It also as one of return values.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<b><span lang="EN-SG">Part of original hex file:<o:p></o:p></span></b></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">:03040000020447AC</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">The data segment is “020447”.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<b><span lang="EN-SG">Part of parsed hex file output:<o:p></o:p></span></b></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">[3572:1121/101801:INFO:CONSOLE(18)] "{"0":2,"1":4,"2":71,</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">It is 02, 04, 71(0x47), the result shows correct value.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><b><span lang="EN-SG">Parse application info block<o:p></o:p></span></b></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<span lang="EN-SG">Here is definition of info block, these information needed display to Table in UI.</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 0.5in; margin-right: 12pt; padding: 6pt 10pt;">
<blockquote class="tr_bq">
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">SEGMENT_VARIABLE(TGT_App_InfoBlock[], const U8, SEG_CODE) =<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">{<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> BL_SPECIFIC_BYTE,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> APP_FW_VERSION_HIGH,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> APP_FW_VERSION_LOW,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> TGT_FLASH_PAGE_SIZE_CODE,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> TGT_BL_TYPE,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> TGT_MCU_CODE,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> TGT_APP_INFOBLOCK_LENGTH,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> SIG_BYTE3,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> SIG_BYTE2,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> SIG_BYTE1,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> SIG_BYTE0,<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">};</span></div>
</blockquote>
</div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><b><span lang="EN-SG">Output to Table<o:p></o:p></span></b></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<span lang="EN-SG">Named table id = ‘infoBlock’ in index.html</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<span lang="EN-SG">Open the table by id in script.js, and handle info block from hex parse result.</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 0.5in; margin-right: 12pt; padding: 6pt 10pt;">
<blockquote class="tr_bq">
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">function infoBlockDisplay(tmp) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var infoTable = document.getElementById('infoBlock');<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> // MCU code<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> infoTable.rows[1].cells[1].innerHTML = '0x' + tmp[FLASH_PAGE_SIZE - 6].toString(16);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> // BL type<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> if (tmp[FLASH_PAGE_SIZE - 7] == 1) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> infoTable.rows[2].cells[1].innerHTML = 'UART';<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> }<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> // Flash page size<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> if (tmp[FLASH_PAGE_SIZE - 8] == 2) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> infoTable.rows[3].cells[1].innerHTML = '1024';<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> } else if(tmp[FLASH_PAGE_SIZE - 8] == 1) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> infoTable.rows[3].cells[1].innerHTML = '512';<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> }<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> // App FW Version<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var ver_high = tmp[FLASH_PAGE_SIZE - 10].toString();<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var ver_low = tmp[FLASH_PAGE_SIZE - 9].toString();<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> infoTable.rows[4].cells[1].innerHTML = ver_high + '.' + ver_low;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> // Reserved<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> infoTable.rows[5].cells[1].innerHTML = '0x' + tmp[FLASH_PAGE_SIZE - 11].toString(16);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> // App Start Addr<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> infoTable.rows[6].cells[1].innerHTML = firmwareStartAddress;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> // App End Addr<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> infoTable.rows[7].cells[1].innerHTML = firmwareEndAddress;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">}</span></div>
</blockquote>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
</div>
</div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><b><span lang="EN-SG">Run result<o:p></o:p></span></b></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<span lang="EN-SG">Press Ctrl + b, click on button “Select Hex file(s)”, and choose Sample_User_Application.hex in file dialog. The result looks good.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCy-tVCy4wUWcLUPPTZX5zVd9p4JS_weq9qFbSTcaVECbEUMadTEOnbYzDMR9SE6JM46rfQ2P1WFyxbeljzEneJRTZqprLDA_2C8bIqhRGpoT2jJZr2etEisH3Mb1u65AMPygocSXMOx8p/s1600/image030.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCy-tVCy4wUWcLUPPTZX5zVd9p4JS_weq9qFbSTcaVECbEUMadTEOnbYzDMR9SE6JM46rfQ2P1WFyxbeljzEneJRTZqprLDA_2C8bIqhRGpoT2jJZr2etEisH3Mb1u65AMPygocSXMOx8p/s1600/image030.png" /></a></div>
<div class="MsoListParagraphCxSpLast" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.75in;">
</div>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">Serial port communication</span></h2>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.25in;">
<span lang="EN-SG">Reference from <a href="https://github.com/voodootikigod/node-serialport" style="color: #954f72;">https://github.com/voodootikigod/node-serialport</a></span></div>
<div class="MsoListParagraph" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">1.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Install serialport plug in for Node.js</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.25in;">
<span lang="EN-SG">Before install serialport plug in for Node.js, we need to install Python 2.76. <a href="http://www.python.org/download/releases/2.7.6/" style="color: #954f72;">http://www.python.org/download/releases/2.7.6/</a>,</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.25in;">
<span lang="EN-SG">$npm install serialport</span></div>
<div class="MsoListParagraph" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">2.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Install nw-gyp</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.25in;">
<span lang="EN-SG">Things become a little difference between normal node.js third party plugin, node-webkit need to rebuild the plug in. Get reference from <a href="https://github.com/rogerwang/node-webkit/wiki/Using-Node-modules" style="color: #954f72;">https://github.com/rogerwang/node-webkit/wiki/Using-Node-modules</a> 3rd party modules with C/C++ addons.</span></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.25in;">
<span lang="EN-SG">$ npm install nw-gyp –g</span></div>
<div class="MsoListParagraphCxSpFirst" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">3.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Rebuild node-webkit</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">Enter serialport module directory.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">$ nw-gyp rebuild --target=0.8.0</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;">
<span lang="EN-SG">4.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">To use</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Output string “OMG IT WORS” to COM4,</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 0.5in; margin-right: 12pt; padding: 6pt 10pt;">
<blockquote class="tr_bq">
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">var serialport = require('serialport');<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">var com = serialport.SerialPort;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">var serialPort = new com('COM4', {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> baudrate: 115200<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">});<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">function serialPortTesting() {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> console.log('COM port open test\n');<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> serialPort.write("OMG IT WORKS\r");<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">}</span></div>
</blockquote>
</div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.5in;">
<span lang="EN-SG">Also add serialPortTesting() function in anywhere you want. Check the COM4 output with serial terminal tool, we can see sting “OMG IT WORKS” appear on the terminal tool. That means the serial port operation works.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">List all COM ports</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 0.5in; margin-right: 12pt; padding: 6pt 10pt;">
<blockquote class="tr_bq">
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> serialport.list(function (err, ports) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> ports.forEach(function(port) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> console.log(port.comName);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> console.log(port.pnpId);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> console.log(port.manufacturer);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> });<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpLast" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> });</span></div>
</blockquote>
</div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt; text-indent: 0.5in;">
<span lang="EN-SG">We can see the output from console.</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 0.5in; margin-right: 12pt; padding: 6pt 10pt;">
<blockquote class="tr_bq">
<div class="MsoListParagraphCxSpFirst" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> ""COM3"",<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> ""USB\\VID_10C4&PID_EA60\\0001"",<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> ""Silicon Laboratories"" ,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> ""COM1"",<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> ""ACPI\\PNP0501\\0"",<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> ""(Standard port types)"",<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> ""COM4"",<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> ""USB\\VID_10C4&PID_EA60\\0003""<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> ""Silicon Laboratories"",</span></div>
</blockquote>
</div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Update COM port dropdown list</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 0.5in; margin-right: 12pt; padding: 6pt 10pt;">
<blockquote class="tr_bq">
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">function serialPortList() {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> serialport.list(function (err, ports) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var coms = [];<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var cnt = 0;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> ports.forEach(function(port) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> coms[cnt++] = port.comName;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> });<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> coms.sort();<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var comPortInput = document.getElementById('comPort');<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> coms.forEach(function(com) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var option = document.createElement('option');<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> option.text = com;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> comPortInput.add(option, null);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> });<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> });<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">}</span></div>
</blockquote>
</div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Open COM Port button function implementation</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 0.5in; margin-right: 12pt; padding: 6pt 10pt;">
<blockquote class="tr_bq">
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">function serialPortOpen() {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var comPortInput = document.getElementById('comPort');<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var comSelected = comPortInput.options[comPortInput.selectedIndex].text;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> console.log(comSelected);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var SerialPort = serialport.SerialPort;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var serialPort = new SerialPort(comSelected, {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> baudrate: 115200<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> }, false);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> serialPort.open(function (err) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> if (err) {<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var textArea = document.getElementById('textArea');<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> var tmp = textArea.value + err + '\n';<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> textArea.value = tmp;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> return;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> }<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> serialPort.write('OMG IT WORKS\r');<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> });<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">}</span></div>
</blockquote>
</div>
<div class="MsoListParagraphCxSpLast" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 0.75in;">
<br /></div>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">Firmware update control function implementation.</span></h2>
<div class="MsoListParagraphCxSpFirst" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">The protocol can get reference from F330 UART bootloader firmware. For quick demonstration purpose, we remove CRC function from firmware. The firmware main loop like below.</span></div>
<div style="background-color: #f5f5d7; border: 1pt solid rgb(202, 202, 200); margin-left: 0.5in; margin-right: 12pt; padding: 6pt 10pt;">
<blockquote class="tr_bq">
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> while(SRC_Disp_TGT_Info() != SRC_RSP_OK);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> SRC_Response = SRC_Get_Info();<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> SRC_Validate_Response(SRC_Response, SRC_CMD_GET_INFO);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> if (Last_Error != 0)<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> goto error;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> Flash_Key0 = rx_buf[5];<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> Flash_Key1 = rx_buf[6];<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> while(1){<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> SRC_Response = SRC_Get_Page_Info();<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> SRC_Page_CRC = rx_buf[4] | (rx_buf[5] << 8);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> page_addr = rx_buf[1] | (rx_buf[2] << 8);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> SRC_Validate_Response(SRC_Response, SRC_CMD_GET_PAGE_INFO);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> if (Last_Error != 0)<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> break;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> // Exit this loop if no more pages are available from source<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> if (SRC_Response == SRC_RSP_DATA_END)<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> break;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> SRC_Response = SRC_Get_Page(Page_Buf);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> SRC_Validate_Response(SRC_Response, SRC_CMD_GET_PAGE);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> if (Last_Error != 0)<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> break;<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> TGT_Erase_Page(page_addr);<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;"> TGT_Write_Flash(Page_Buf, page_addr);<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="border: none; font-family: Calibri, sans-serif; font-size: 11pt; line-height: 13.5pt; margin: 12pt 0in; padding: 0in; word-break: break-all;">
<span lang="EN-SG" style="color: #dd1144; font-family: Consolas; font-size: 10.5pt;">}</span></div>
</blockquote>
</div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in;">
<span lang="EN-SG" style="font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Test result.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG">a.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Prepare C8051F330-TB board.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG">b.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Download UART bootloader firmware in it.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG">c.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Connect UART interface to PC, it appears COM4.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG">d.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Press Ctrl+b to run the HTML5 updater.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG">e.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Select blink sample application hex file by clicking Select Hex Files button.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG">f.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">Select COM4 from dropdown list, and click on Open COM Port button.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG">g.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">The blinky application will download to target board automatically. And reset MCU at end of updating.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;">
<span lang="EN-SG">h.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">We can see a green LED(D2) on board is blinking.</span></div>
<div class="MsoListParagraphCxSpLast" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt 1in; text-indent: -0.25in;">
<span lang="EN-SG">i.<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span lang="EN-SG">We are done!</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIendjA9uOc3AL4_Z5u0BtpEEF-Jg8WiXXA3YYyQ9qoIhZEKgOM_P_4UiSVshNwSlCEIDvgljzmBF5MGDA-XZSVgl76-ypl6shi_1zPGWESec5Yjb3G_G9cu5qH67OvxHwl-nrpExmovp2/s1600/image031.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIendjA9uOc3AL4_Z5u0BtpEEF-Jg8WiXXA3YYyQ9qoIhZEKgOM_P_4UiSVshNwSlCEIDvgljzmBF5MGDA-XZSVgl76-ypl6shi_1zPGWESec5Yjb3G_G9cu5qH67OvxHwl-nrpExmovp2/s1600/image031.png" /></a></div>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<br /></div>
<h2 style="color: #2e74b5; font-family: 'Calibri Light', sans-serif; font-size: 13pt; font-weight: normal; line-height: 18px; margin: 2pt 0in 0.0001pt; page-break-after: avoid;">
<span lang="EN-SG">Source code</span></h2>
<div class="MsoNormal" style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 16px; margin: 0in 0in 8pt;">
<span lang="EN-SG"> The source code can be found from https://github.com/MarkDing/HTML5_UART_BL</span></div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-44867500942758990122013-09-25T07:19:00.000-07:002013-09-25T07:19:06.403-07:00EEPROM EMULATION FOR 8-BIT FLASH MCU <h1>
<a href="" name="RTF32383433303a204865616431"><!--[if !supportLists]--><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; font-weight: normal; line-height: 115%; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-font-kerning: 0pt; mso-hansi-theme-font: minor-latin;">1<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-family: "Arial","sans-serif";">Introduction</span></a><span style="font-family: "Arial","sans-serif";"><o:p></o:p></span></h1>
<div class="Para1">
<span lang="EN-US">This post demonstrates a way to use the flash memory of the 8-bit flash MCU families
to emulate single variable rewritable EEPROM memory through software. The
example API provided enables reading and writing of single variables to
non-volatile flash memory. The erase-rewrite algorithm distributes page erases
and thereby doing wear leveling.<o:p></o:p></span></div>
<h1>
<!--[if !supportLists]--><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; font-weight: normal; line-height: 115%; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-font-kerning: 0pt; mso-hansi-theme-font: minor-latin;">2<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-family: "Arial","sans-serif";">General
Theory<o:p></o:p></span></h1>
<br />
<h2>
<!--[if !supportLists]--><span style="font-family: Calibri, sans-serif; font-size: 11pt; font-weight: normal; line-height: 115%;">2.1<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-family: Arial, sans-serif;">EEPROM and Flash Based Memory<o:p></o:p></span></h2>
<div>
<div class="Para1">
<span lang="EN-US">EEPROM stands for
Electrically Erasable Programmable Read-Only Memory and is a type of
nonvolatile memory that is byte erasable and therefore often used to store
small amounts of data that must be saved when power is removed. Most of 8 bit MCU
does not include an embedded EEPROM module for byte erasable non-volatile
storage, but for C8051Fxxx MCU families do provide flash memory for
non-volatile data storage. The main difference between flash memory and EEPROM
is the erasable unit size. Flash memory is block-erasable which means that
bytes cannot be erased individually, instead a block consisting of several
bytes need to be erased at the same time. Through software however, it is possible
to emulate individually erasable rewritable byte memory using block-erasable
flash memory.<o:p></o:p></span></div>
<div class="Para1">
<br /></div>
<div class="Para1">
<span lang="EN-US">To provide EEPROM
functionality for the 8 bit flash MCU in an application, there are at least two
options available. The first one is to include an external EEPROM module when
designing the hardware layout of the application. The other is to use the
on-chip flash memory and emulate EEPROM functionality through a software API.
There are however some key differences between these two methods.<o:p></o:p></span></div>
<div class="Para1">
<span lang="EN-US">• First, the write
access time for flash memory is shorter than for external EEPROM. This means
that writing to emulated EEPROM is faster than writing to an external EEPROM.<o:p></o:p></span></div>
<div class="Para1">
<span lang="EN-US">• Second, while a
standalone EEPROM will be able to complete a write operation even if the system
is reset, the emulated EEPROM will need the CPU to be active throughout the
entire flash operation. This is an important difference. The consequences of an
aborted flash operation should be taken into account when designing an
application. The flash based EEPROM emulation could use checksums and logging
to ensure the integrity of written data.<o:p></o:p></span></div>
<div class="Para1">
<span lang="EN-US">• Lastly the
emulated EEPROM will regularly need to erase pages in flash, to free space and
be able to write to the same page more than once. On a standalone EEPROM there
is no need for a dedicated erase operation, since all bytes can be rewritten
independently. Here it is also important to notice that the flash erase
operation will need the CPU to be running safely for the entire operation.<o:p></o:p></span></div>
<div class="Para1">
<br /></div>
<div class="Para1">
<span lang="EN-US">In addition to the
risk of power failure or system reset aborting flash write or erase operations,
one must also handle internal sources like disable interrupts and enable VDD
monitor while performing the flash write/erase operations. This can be done in
software.<o:p></o:p></span></div>
<h2>
<!--[if !supportLists]--><span style="font-family: Calibri, sans-serif; font-size: 11pt; font-weight: normal; line-height: 115%;">1.1<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-family: Arial, sans-serif;">Flash Limitations<o:p></o:p></span></h2>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">Flash memory is limited to a finite number
of program-erase cycles. This means that the embedded flash memory of the MCU
can be erased only a certain number of times, before the wear will begin to
affect the integrity of the storage. This deterioration applies to all kinds of
flash memory. All 8 bit flash MCUs are guaranteed to withstand a number of
erase cycles. This number can be found in the data sheet for each part.<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">All flash memory is divided into pages
that each must be erased as single units. The amount of on-chip flash memory and
the page size found in the different 8 bit MCU varies depending on the specific
part. See the Reference Manual for more information about the page size.
Because the erase operation erases only whole pages, it is important to write
as much data as possible to a single page of flash, before erasing the page.<o:p></o:p></span></div>
<h1>
<!--[if !supportLists]--><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; font-weight: normal; line-height: 115%; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-font-kerning: 0pt; mso-hansi-theme-font: minor-latin;">2<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-family: "Arial","sans-serif";">Implementation<o:p></o:p></span></h1>
<div class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">There are different ways to implement an
EEPROM Emulator using flash memory. The idea behind the example attached in
this application note, is to allocate a certain number of pages of flash memory
for the entire lifetime of the application. The wear is then leveled among
these by alternating which pages are used. The number of pages allocated must
reflect the amount of data that will be written throughout the application
lifetime.<o:p></o:p></span></div>
<h2>
<!--[if !supportLists]--><span style="font-family: Calibri, sans-serif; font-size: 11pt; font-weight: normal; line-height: 115%;">2.1<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-family: Arial, sans-serif;">Pages and Their States</span><span style="font-family: "Arial","sans-serif";"><o:p></o:p></span></h2>
<div class="Para1">
<span lang="EN-US">In every page
allocated to the EEPROM Emulator provided, the first dword is reserved for page
head data. This head dword contains the status of the page and the erase count.
The erase count is the number of times the page has been erased. The erase
count is incremented each time the page is erased. Each page will always be in
one of three different states. Active, Receiving or Erased.<o:p></o:p></span></div>
<div class="Para1">
<span lang="EN-US">• After a page is
erased, all bits in the entire page are 1's except head data of the page.<o:p></o:p></span></div>
<div class="Para1">
<span lang="EN-US">• When a page is
receiving, it means that a transfer of variables from a full active page is in
progress. After the transfer is complete, the receiving page is made the new
active one, and the old active page is erased.<o:p></o:p></span></div>
<div class="Para1">
<span lang="EN-US">• The active page
is the page that contains the currently valid data. All read and write
operations are made on the active page. There should never be more than one
active or receiving page at any time in this implementation.<o:p></o:p></span></div>
<div class="TableAnchor" style="text-align: justify; text-justify: inter-ideograph;">
<br /></div>
<div class="Para1">
<span lang="EN-US">
<span style="font-family: "Calibri","sans-serif"; font-size: 10.0pt; line-height: 115%; mso-ansi-language: EN-SG; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;">Fig
3.1 shows the state flow for a realization using 2 pages. The flow would be
similar if more pages are allocated; only more pages would be in the erased
state simultaneously.</span></span></div>
<div class="Para1">
<span lang="EN-US"><b style="text-align: center;"><span lang="EN-US"> Figure 3.1 EEPROM
Emulation Page Status Flow.</span></b><span style="font-family: "Calibri","sans-serif"; font-size: 10.0pt; line-height: 115%; mso-ansi-language: EN-SG; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;"> </span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0ybQDMmNfaMw3ipz2jw-upocK6xgfstigCHslBTdOweu24eDl7vM94NYQB839zes7Si1ZmOzTUtUTZbdTuEYtKqCn0iqpXh-5HNj5ppwgNZHqTNKf_DTm5bH4vAEbt1LcWlOil4k9EB2_/s1600/eeprom+page+status+flow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0ybQDMmNfaMw3ipz2jw-upocK6xgfstigCHslBTdOweu24eDl7vM94NYQB839zes7Si1ZmOzTUtUTZbdTuEYtKqCn0iqpXh-5HNj5ppwgNZHqTNKf_DTm5bH4vAEbt1LcWlOil4k9EB2_/s1600/eeprom+page+status+flow.png" /></a></div>
<div class="TableAnchor">
<span lang="EN-US" style="font-size: 10.0pt; mso-font-width: 100%;">During initialization, the page status for the selected number of pages
is checked, to ensure that a legal set of page-states are obtained. If there is
more than one active page, the page which is full will be erased. And receiving
status page will be erased. This minimizes the probability for data collisions
with program instructions, which are located at the base of the flash. In
applications where much of the available flash memory is in use, it can be
critical to know where all data is stored in the flash to avoid collisions. <o:p></o:p></span></div>
<div class="TableAnchor">
<br /></div>
<div class="separator" style="clear: both;">
</div>
<div class="TableAnchor">
<span lang="EN-US" style="font-size: 10.0pt; mso-font-width: 100%;">The remaining words of each page, after the page head data, are free to
be used for data storage. Each data storage word is divided into two parts; one
virtual address field and one data field. Each of them is 8 bits wide. Whenever
a page is full, a page transfer is initiated. This operation consists of
several steps to always ensure that all variables are non-volatile in case of
an external event. First, an erased page is located to store the valid data
present in the full page. This page is marked as receiving. Next, the most
recent data associated with each variable is transferred to the top of the new page.
When this is done, the old active page is erased, the erase count is written to
the old active page header, and receiving page is labeled as the new active
page. This process is illustrated in Figure 3.2.<o:p></o:p></span></div>
<div class="TableAnchor" style="text-align: center;">
<span lang="EN-US"><b><span style="font-family: Calibri, sans-serif; line-height: 115%;">Figure
3.2. EEPRO Emulation Variable Flow</span><span style="font-family: Calibri, sans-serif; font-size: 10pt; line-height: 115%;">.</span></b></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpducORdWM19R6zCNtYswJcyL2zTQeDu1v6g1L9yMVn513KO_kB8mijfQldc_7RS4d6SAaH-ZhBOzxPUApEtA8b9tegy51N4x5yiZnhTfKB6xnylGEsqSbUxTpilHMpO6vnrcRt901tt6J/s1600/eeprom-virable-flow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpducORdWM19R6zCNtYswJcyL2zTQeDu1v6g1L9yMVn513KO_kB8mijfQldc_7RS4d6SAaH-ZhBOzxPUApEtA8b9tegy51N4x5yiZnhTfKB6xnylGEsqSbUxTpilHMpO6vnrcRt901tt6J/s1600/eeprom-virable-flow.png" /></a></div>
<h2>
<span style="font-weight: normal;"><span style="font-family: Calibri, sans-serif;"><span style="font-size: 15px; line-height: 17px;">3.2. </span></span><span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><!--[endif]-->Read and Write<o:p></o:p></h2>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">Reading
consists of iteration through the active page, starting from the bottom. When
the correct virtual address is found for the first time, the corresponding data
is returned as the currently valid data. <o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">The write
operation consists of a similar iteration, only which it is starting at the top
of the active page. When an empty word is found, the correct virtual address
and data are written, and the function returns. If no empty word is found, and
the end of the page is reached, the page is considered full. <o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">In this
implementation all valid data has to fit in one page (the active page). The
page size therefore puts a direct limitation on the number of variables. Each
variable uses 2 bytes (1 byte for data and 1 byte for the virtual address) and
4 bytes per page is reserved for the Page Status Header. We default set the
EEPROM size no more than 1/4 flash page size. And also 8 bit alignment. For
example, 512 bytes page size, the maximum EEPROM size is:<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">Nmax = ((512
- 4) / 4) & 0xF8 = 127 & 0xF8 = 120. <o:p></o:p></span></div>
<h2>
<span lang="EN-US" style="font-weight: normal;"><span style="font-family: Calibri, sans-serif;"><span style="font-size: 15px; line-height: 17px;">3.3. </span></span><span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US">Initialization and Recovery<o:p></o:p></span></h2>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">An important
part of EEPROM emulation software, is to ensure correct page state, and data
recovery on system startup. For this reason, the initialization function should
be run near the start of the software, before any data is written or read
to/from EEPROM. The initializing function will decide how many pages that are
allocated to the emulator, it will then check the head of each of these pages
to ensure that the set of pages are valid. There are several conditions we need
to handle.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 10pt; line-height: 115%;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">Erased page<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">It is not formatted, simply format this page. The format operation
contains erase the page, and update erase count in page header data. <o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 10pt; line-height: 115%;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">Page with receiving status<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">Simply format this page; this situation can be caused by an uncompleted
page transfer.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 10pt; line-height: 115%;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">Two more pages with active status.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">Compare with two pages; simply format the page which is full. <o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle">
<br /></div>
<div class="MsoListParagraphCxSpLast">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">Once status check completed, it will scan current active page, and update
page information.<o:p></o:p></span></div>
<h2>
<span lang="EN-US" style="font-weight: normal;"><span style="font-family: Calibri, sans-serif;"><span style="font-size: 15px; line-height: 17px;">3.4 </span></span><span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US">Configurable Options<o:p></o:p></span></h2>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">The
firmware supports all 8 bit flash MCU families. Define the device being used in
flash_parameters.h, (i.e. C8051F850) <o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">#define
C8051F850<o:p></o:p></span></div>
<div class="separator" style="clear: both;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;">The
EEPROM emulation firmware has following parameters can be configured. These
parameters are located in head file eeprom_config.h. </span></div>
<div class="TableAnchor" style="text-align: center;">
<span lang="EN-US"><b><span style="font-family: Calibri, sans-serif; font-size: 10pt; line-height: 115%;"><br /></span></b></span></div>
<div class="Para1">
<span lang="EN-US"></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 125.9pt;" valign="top" width="168">
<div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<b><span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt;">Parameter<o:p></o:p></span></b></div>
</td>
<td style="border-left: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 388.9pt;" valign="top" width="519">
<div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<b><span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt;">Options<o:p></o:p></span></b></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 125.9pt;" valign="top" width="168">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt;">FL_PAGES<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 388.9pt;" valign="top" width="519">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt;">Pages used for EEPROM emulation: 2<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 125.9pt;" valign="top" width="168">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt;">EE_BASE_ADDR<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 388.9pt;" valign="top" width="519">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt;">EEPROM storage area begins: LOCK_PAGE -
FL_PAGE_SIZE * FL_PAGES<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 125.9pt;" valign="top" width="168">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt;">EE_SIZE<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 388.9pt;" valign="top" width="519">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt;">Number of bytes of EEPROM: 16 <o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 125.9pt;" valign="top" width="168">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt;">EE_TAG_SIZE<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 388.9pt;" valign="top" width="519">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt;">Number of bytes for page head data: 4 <o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 125.9pt;" valign="top" width="168">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt;">EE_VARIABLE_SIZE<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 388.9pt;" valign="top" width="519">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="font-family: Arial, sans-serif; font-size: 10pt;">Number of bytes used per EEPROM data: 2<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
</div>
<h2>
4.<span style="font-weight: normal;"> Source code</span></h2>
<div>
Source code can be found in <a href="https://github.com/MarkDing/eeprom-emulation">https://github.com/MarkDing/eeprom-emulation</a></div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-38513005062105502082013-06-27T00:14:00.001-07:002013-06-27T00:14:28.975-07:00How to install JekyII under windows (Github wiki page)<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-SG</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";
mso-ansi-language:EN-SG;
mso-fareast-language:ZH-CN;}
</style>
<![endif]-->
<br />
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 20.0pt; mso-ansi-language: EN-US;">How to install
JekyII under windows.</span></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l5 level1 lfo1; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Install Ruby
2.0.0</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span lang="EN-SG"><a href="http://rubyforge.org/frs/download.php/76955/rubyinstaller-2.0.0-p195.exe"><span lang="EN-US" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">http://rubyforge.org/frs/download.php/76955/rubyinstaller-2.0.0-p195.exe</span></a></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l3 level1 lfo2; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Install Ruby
DevKit for Ruby 2.0.0</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Download it from </span><span lang="EN-SG"><a href="http://rubyforge.org/frs/download.php/76805/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe"><span lang="EN-US" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">http://rubyforge.org/frs/download.php/76805/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe</span></a></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Extract it to C:\devkit, enter the directory and
execute below commands.</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">$ ruby dk.rb init </span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span lang="EN-SG" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt;">to generate the config.yml file to be used later in
this Step</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">$ ruby dk.rb install</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span lang="EN-SG" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt;"> This step installs (or updates) an
operating_system.rb file into the relevant directory needed to implement a
RubyGems</span></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l0 level1 lfo3; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Add Taobao
ruby in<span style="mso-spacerun: yes;"> </span>gem mirror list. This is because
GFW blocking.</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">$ gem sources --remove </span><span lang="EN-SG"><a href="http://gemcutter.org/"><span lang="EN-US" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">http://gemcutter.org/</span></a></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">$ gem sources --remove </span><span lang="EN-SG"><a href="http://rubygems.org/"><span lang="EN-US" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">http://rubygems.org/</span></a></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">$ gem sources -a </span><span lang="EN-SG"><a href="http://ruby.taobao.org/"><span lang="EN-US" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">http://ruby.taobao.org/</span></a></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l6 level1 lfo4; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Install
jekyll </span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">$ gem install jekyll rdiscount</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">This might be long time, please be patient to wait for
it complete.<span style="mso-spacerun: yes;"> </span></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">...</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: liquid-2.5.0.gem (100%)</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed liquid-2.5.0</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: fast-stemmer-1.0.2.gem (100%)</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Temporarily enhancing PATH to include DevKit...</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Building native extensions.<span style="mso-spacerun: yes;"> </span>This could take a while...</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed fast-stemmer-1.0.2</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: classifier-1.3.3.gem (100%)</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed classifier-1.3.3</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: directory_watcher-1.4.1.gem (100%)</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed directory_watcher-1.4.1</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: syntax-1.0.0.gem (100%)</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed syntax-1.0.0</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: maruku-0.6.1.gem (100%)</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed maruku-0.6.1</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: kramdown-1.0.2.gem (100%)</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed kramdown-1.0.2</span></i><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: yajl-ruby-1.1.0-x86-mingw32.gem (100%)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed yajl-ruby-1.1.0-x86-mingw32</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: posix-spawn-0.3.6.gem (100%)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Temporarily enhancing PATH to include DevKit...</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Building native extensions.<span style="mso-spacerun: yes;"> </span>This could take a while...</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed posix-spawn-0.3.6</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: pygments.rb-0.5.1.gem (100%)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed pygments.rb-0.5.1</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: highline-1.6.19.gem (100%)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed highline-1.6.19</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: commander-4.1.3.gem (100%)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed commander-4.1.3</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: safe_yaml-0.7.1.gem (100%)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed safe_yaml-0.7.1</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: colorator-0.1.gem (100%)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed colorator-0.1</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: jekyll-1.0.3.gem (100%)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed jekyll-1.0.3</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Parsing documentation for yajl-ruby-1.1.0-x86-mingw32</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">unable to convert "\x90" from ASCII-8BIT to
UTF-8 for lib/yajl/1.8/yajl.so, skip</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">ping</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">unable to convert "\x90" from ASCII-8BIT to
UTF-8 for lib/yajl/1.9/yajl.so, skip</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">ping</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Installing ri documentation for
yajl-ruby-1.1.0-x86-mingw32</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Parsing documentation for posix-spawn-0.3.6</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Installing ri documentation for posix-spawn-0.3.6</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Parsing documentation for pygments.rb-0.5.1</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Installing ri documentation for pygments.rb-0.5.1</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Parsing documentation for highline-1.6.19</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Installing ri documentation for highline-1.6.19</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Parsing documentation for commander-4.1.3</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Installing ri documentation for commander-4.1.3</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Parsing documentation for safe_yaml-0.7.1</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Installing ri documentation for safe_yaml-0.7.1</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Parsing documentation for colorator-0.1</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Installing ri documentation for colorator-0.1</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Parsing documentation for jekyll-1.0.3</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Installing ri documentation for jekyll-1.0.3</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Fetching: rdiscount-2.1.6.gem (100%)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Building native extensions.<span style="mso-spacerun: yes;"> </span>This could take a while...</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Successfully installed rdiscount-2.1.6</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Parsing documentation for rdiscount-2.1.6</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">unable to convert "\x90" from ASCII-8BIT to
UTF-8 for lib/rdiscount.so, skipping</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">Installing ri documentation for rdiscount-2.1.6</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">9 gems installed</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">…</span></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l7 level1 lfo5; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">5.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Check<span style="mso-spacerun: yes;"> </span>Jekyll version</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">$ jekyll -v </span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">jekyll 1.0.3</span></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l2 level1 lfo6; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">6.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Install
RedCloth</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">$ gem install RedCloth</span></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l1 level1 lfo7; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span lang="EN-SG" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">7.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Download </span><span lang="EN-SG" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-fareast-font-family: "Times New Roman";">Tom Preston-Werner Jekyll example</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span lang="EN-SG"><a href="https://github.com/mojombo/mojombo.github.io/archive/master.zip"><span lang="EN-US" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">https://github.com/mojombo/mojombo.github.io/archive/master.zip</span></a></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span lang="EN-SG" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt;">Extract it into your own github local directory. I
changed the name to "blog"</span></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l4 level1 lfo8; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">8.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Highlight
code</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span lang="EN-SG"><a href="https://gist.github.com/"><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt;">https://gist.github.com/</span></a><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt;"> </span></span></div>
<br />
<span lang="EN-SG"><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt;"> 9. Reference</span></span><br />
<div style="margin-bottom: .0001pt; margin: 0in;">
<span lang="EN-SG"><a href="http://yanping.me/cn/blog/2012/03/18/github-pages-step-by-step/"><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt;">http://yanping.me/cn/blog/2012/03/18/github-pages-step-by-step/</span></a></span><span lang="EN-SG" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt;"></span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span lang="EN-SG"><a href="http://www.madhur.co.in/blog/2011/09/01/runningjekyllwindows.html"><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt;">http://www.madhur.co.in/blog/2011/09/01/runningjekyllwindows.html</span></a></span><span lang="EN-SG" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt;"></span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<br /></div>
<br />
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<br /></div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-50964553446565553672013-05-23T02:21:00.003-07:002013-05-23T02:21:34.051-07:00Doxygen work with Eclipse<img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAroAAAGeCAIAAAD0SjXzAAAgAElEQVR4nO2dP7KzuNKHWdV7q9jLJG+gdUw6GWuYBUxIPlu4qaPZw9R3q27NLb4AA63+IwmMbXzO89QJjrGQWi0h/dRg1E0AAAAARbp3GwAAAABXB7kAAAAAFZALAAAAUOFacmFMXZfGE3Lph9sZ9gAAAMDUIBduQ99JHp/NC7xVLry0pgAAAB9Ek1zYJt8xdd0Tl+5vlwsvqykAAMAHsVMuTGpKlyvy+8Hb0G/fZ4nXD3OSMd1PzOfoTS44mavDXtp+GKRccDMZ05wsO7i7ptkZy/+2CvcUa3WNt/JDoXMAAADexX65kM/62dQpxcD9YOp7qyPmOVJMo0sm4v8g82lMeoJWRmZhAZm5mbpVHGN/TbdzVN62yC3iIeWUlzZ0DgAAwLt4QC5kYYRJzIhylk3jMr9nKkKeKe4dbLNjmLkyTQuULK223Vr4YE3vafpe38bQlVAaoWRe6BwAAIB38YBc0HP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cAAACgAnIBAAAAKiAXAAAAoAJyAQAAACogFwAAAKACcgEAAAAqIBcAAACgAnIBAAAAKiAXAAAAoAJyAQAAACogFwAAAKACcgEAAAAqIBcAAACgAnIBAAAAKiAXAAAAoAJyAQAAACogFwAAAKDCteTC3wAX4N3XAQDA5UAuAGjefR0AAFwO5AKA5t3XAQDA5UAuAGjefR0AAFyO0+TCmLoujQ9m8u5pAuDvv5ELAACGqly4DX0n6Yebm+4kufCfn90/f5w79v/7vz9+/Pff+uMTCrogqu7ltL/978dv//fsUhp4f9M82I0BAL4eTXKhRQY8Uy78328//vfbv+3/TahZcPn4/jnpBexSAIflwnbiohuOK4+//641ze4OIPnj59T9/E81nwe7MQDA1+OoXBBBh/nbXC7ImMRy9Db0a2xC/i94glz4z89Opl8/fge5oOpe4egcL0r54595Mv73b//7edy5T5QLjfkcvZoAAL4sx+TCmLa7EmPqh1smF25Dn4sE+UU/3CKxsMiF3377X9dNXTf9/GMe1qf5Y/fjn5/b//cbCmviZar7z8/7iX///fc2gZmPtqAlQTflB//z88d/f/s5H/znj7//8zMr7u9/L5lkBc2Z/ZzW3KzBW/5rGnd2d0z6v99+/O/nz/+tZpiCdN0dI7ds74VmcsEW+sc/S875RCskwmbDPVs58a//u60mSvz5j0ipPCM7wz2METk/S7yYsdSxks/x6wkA4Iuy99mFNE7+jYftmBYYY9q0wZi6ru8DsXCXC8vQ/8c/yygfRRf+8zNTCc5c+8fPSS5zxUevoH//98eayfb/VsofP5d569///bGeskzPqizxlQxp2NpJc//p1EMAvkn/99sPMUE6BeX2OEY67sruKTiF/v3Hz+nHb/+nghCy1mIytiEcKRdsq232/Pu3/xU9IzpAwfl/G6Wo6ljM5+DFBADwdTkUXZACQBxzb0voHMbUxQ85BBNMQS5s84ozYeiwtpu5+D+fYObZUab892//U3e+1ZI6C+b7csExIMtEyQXfpHx978uFIP/ZSKtL5FTqF/r3styPXCq1yBZIcKML+pTMnrJntrrbev07C1pYa325YPNpvXoAAL4NR+XC8ehCP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ozuw7pa2zohGjhUSwVJ7dra1qs8Aoamuu1eUDKx/+MhKRxdnM6SrWV2dFTTdk65kRNOlAv5DJwFo0td0cqFtj7veqlVLjR0nqjnm7xq7vWumaiJPblQvSisXCgEWVvkQt4vvcThNRXkas0sZpKdXxpDGpug0r73IahSqRZBAW/h6HsXtsPu9SeCZN5w5i/57smHlI3Hy9LNi5vJ4V0X1yIXonLz/E14wFTc5BDLhXsGzsWw5ZzG29CrKc5WUDuhksyP+AnPKZu8ejXNZNqGoN3zmE1uQ+j/0ACZhxUx0Xd7O6ptO69ctyEelgtuS1lH6SZztPHuPu94qaE67Z0n7PnGkIp7xXDhNlEUrp/2XBSB81vb0S2xlDi4roNc9zjNV/wm2a4m8CyzQ1A4UPhuh4vAS6BfDpG2s7Er42fd+7SRoteUCxVYjwI8HeTCq0EtnE5xEn9eQa8rF2ogFwCeDnLhxaAWnkEW23zanF2JyqIV3gdyAeDpIBcAAACgAnIBAAAAKvw/BaiRb0OsrEwAAAAASUVORK5CYII=" />Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-42626388720602268852013-05-20T03:58:00.002-07:002013-05-20T03:58:46.661-07:00How to implement USB Mass Storage Class on SiM3U1xx<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 17pt;"><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"><span>1.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Introduction.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14pt; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;">The</span><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;"> <b>USB mass storage device class</b></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;">, otherwise known as</span><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;"> <b>USB MSC</b> </span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;">or</span><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;"> <b>UMS</b></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;">, is a protocol that allows a</span><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;"> </span><a href="https://en.wikipedia.org/wiki/Universal_Serial_Bus" style="color: purple; text-decoration: underline;"><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Calibri, sans-serif; font-size: 11pt;">Universal Serial Bus</span></a><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;"> </span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;">(USB) device to become accessible to a host computing device, to enable file transfers between the two. To the host device, the USB device appears similar to an external hard drive, enabling</span><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;"> </span><a href="https://en.wikipedia.org/wiki/Drag-and-drop" style="color: purple; text-decoration: underline;"><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Calibri, sans-serif; font-size: 11pt;">drag-and-drop</span></a><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;"> </span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;">file transfers.</span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14pt; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;">The USB mass storage device class comprises a set of computing</span><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;"> </span><a href="https://en.wikipedia.org/wiki/Protocol_(computing)" style="color: purple; text-decoration: underline;"><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Calibri, sans-serif; font-size: 11pt;">communications protocols</span></a><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;"> </span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;">defined by the</span><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;"> </span><a href="https://en.wikipedia.org/wiki/USB_Implementers_Forum" style="color: purple; text-decoration: underline;"><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Calibri, sans-serif; font-size: 11pt;">USB Implementers Forum</span></a><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;"> </span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 11pt;">that run on the Universal Serial Bus. The standard provides an interface to a variety of storage devices.</span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"><span>2.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">USB Mass Storage Class.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">2.1.<span> <span class="Apple-converted-space"> </span></span>We can find all Mass Storage Class documentation from USB<span class="Apple-converted-space"> </span></span><a href="http://www.usb.org/developers/devclass_docs" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">http://www.usb.org/developers/devclass_docs</span></a><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">. Below are the list of the documentations.<span> <span class="Apple-converted-space"> </span></span>Download them all into your local driver.</span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSgqP9s70mTzXvKbUn6ZKp5TnlIBj5xaOdN_WCxqguYLz_VRCoSfKbJKn6hTGieYP4YR2bb5fVLslFqC2_vNR7-UzbRAdKxvBRfyKmUoihV6EVjKEgmpYXyZ9TxtP7AAuvHFwYYrk6Lokg/s1600/image001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSgqP9s70mTzXvKbUn6ZKp5TnlIBj5xaOdN_WCxqguYLz_VRCoSfKbJKn6hTGieYP4YR2bb5fVLslFqC2_vNR7-UzbRAdKxvBRfyKmUoihV6EVjKEgmpYXyZ9TxtP7AAuvHFwYYrk6Lokg/s1600/image001.png" /></a></div>
<br />
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">We can there are several specifications, which on should we take? We can have an example to go through it.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">2.2. Get USB mass storage example code.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">As we plan to implement USB Mass Storage Class base on LUFA on SiM3U1xx, first we can get source code from</span><a href="https://github.com/abcminiuser/lufa/tree/master/Demos/Device/LowLevel/MassStorage" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">https://github.com/abcminiuser/lufa/tree/master/Demos/Device/LowLevel/MassStorage</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">2.2.1 Let's check descriptors.c.<span> <span class="Apple-converted-space"> </span></span>In configuration descriptor, we have blow setting.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">...</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 76.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">.MS_Interface =</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 76.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 76.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">...</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 76.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">.Class<span> <span class="Apple-converted-space"> </span></span>= MS_CSCP_MassStorageClass,<span> <span class="Apple-converted-space"> </span></span>// 0x8</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 76.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">.SubClass<span> <span class="Apple-converted-space"> </span></span>= MS_CSCP_SCSITransparentSubclass, //0x06</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 76.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">.Protocol<span> <span class="Apple-converted-space"> </span></span>= MS_CSCP_BulkOnlyTransportProtocol, //0x50</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 76.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">...</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 76.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">...</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">For Class =0x08, that means this is Mass Storage Class;</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">For SubClass = 0x06,<span> <span class="Apple-converted-space"> </span></span>Let's check Mass_Storage_Specification_Overview_v1.4_2-19-2010.pdf, here is the table</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Here is definition of SubClass:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>The Interface Descriptor of a USB Mass Storage Class device includes a bInterfaceSubClass field. This field</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">denotes the industry-standard command set transported by a Mass Storage Class interface. The value of the</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">bInterfaceSubClass field shall be set to one of the Subclass codes as shown in table 1.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The Subclass code values used in the bInterfaceSubClass field specify the industry-standard specification that</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">defines transport command sets transported by the interface; these Subclass codes do not specify a type of</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">storage device (such as a CD-ROM or floppy disk drive).</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhigI5idhsHyPZyVMU1szAWvmv4_0P2DHoiQk3zmv043eg9tSUkMJfbut8wE3IJ6S3Am348ckdjSNlP7Hm7JZg-6c6speaHR0kMZEEF1N66PJMln1gQYJKqBag87-FnUA0Q6iHNLhukHiiW/s1600/image003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhigI5idhsHyPZyVMU1szAWvmv4_0P2DHoiQk3zmv043eg9tSUkMJfbut8wE3IJ6S3Am348ckdjSNlP7Hm7JZg-6c6speaHR0kMZEEF1N66PJMln1gQYJKqBag87-FnUA0Q6iHNLhukHiiW/s1600/image003.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">From above table, we know that our command set is "SCSI transparent command set"</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">For Protocol = 0x50, we can find below descriptions from Mass_Storage_Specification_Overview_v1.4_2-19-2010.pdf.</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The Interface Descriptor of a USB Mass Storage Class device includes a bInterfaceProtocol field. This field</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">denotes the transport protocol used by this interface.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzxKkhzOe9FG-AX-SBxzu-gyYIQ7nBxb61sXS0PcfYU9II6l4G3U30A3HKF_H3GsH7Or3savRrsXlyHA-5O63iR0b3sAyDiLF1xdhVubQdepFe_IQgyXBtoQJlvZRHXrjKrtrM9IWMmGPK/s1600/image005.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzxKkhzOe9FG-AX-SBxzu-gyYIQ7nBxb61sXS0PcfYU9II6l4G3U30A3HKF_H3GsH7Or3savRrsXlyHA-5O63iR0b3sAyDiLF1xdhVubQdepFe_IQgyXBtoQJlvZRHXrjKrtrM9IWMmGPK/s1600/image005.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The USB Mass Storage Class Control/Bulk/Interrupt (CBI) Transport specification (Protocol codes 0x00 and</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">0x01) is approved for use only with full-speed floppy disk drives. CBI shall not be used in high-speed capable</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">devices, or in devices other than floppy disk drives. Usage of CBI for any new design is discouraged.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">From above table, we can know protocol implementation is "USB Mass Storage Class Bulk-Only(BBB) Transport"</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">2.2.2 Control request for bulk-only transport, in masstorage.c</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">void EVENT_USB_Device_ControlRequest(void)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 76.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">/* Process UFI specific control requests */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 76.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">switch (USB_ControlRequest.bRequest)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 76.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 103.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">case MS_REQ_MassStorageReset:<span> <span class="Apple-converted-space"> </span></span>//0xFF</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 130.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">...</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 130.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 103.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">case MS_REQ_GetMaxLUN: // 0xFE</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 130.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">...</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 130.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 76.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: 'Courier New'; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">These two requests can be found in Mass_Storage_Specification_Overview_v1.4_2-19-2010.pdf also.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Core USB specifies that a USB control Request addressed to wIndex = bInterfaceNumber of a USB Mass</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Storage Class device interface includes a bRequest field.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The meaning of the bRequest code is specific to the device vendor when the bmRequestType. Type is Vendor,</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">but the meaning of the bRequest code is specific to the interface class when the bmRequestType.Type is Class.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj6wXlT7YOt62ip5JLIdi95mGURJXaIFTl7YpWpDhE5SRtE43N620kz3-_RWXNHZ0B4UhDtb4I4R6xfIgmKvDw4E71ycphbOri8Oo8bGUXy4WyH9Ofyq02KF2TM_1gDxR0Jnyz9CvEBDAe/s1600/image007.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj6wXlT7YOt62ip5JLIdi95mGURJXaIFTl7YpWpDhE5SRtE43N620kz3-_RWXNHZ0B4UhDtb4I4R6xfIgmKvDw4E71ycphbOri8Oo8bGUXy4WyH9Ofyq02KF2TM_1gDxR0Jnyz9CvEBDAe/s1600/image007.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">And we know for the BBB transport protocol, we need to support 0xFE and 0xFF requests.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">USB mass storage bulk only</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Since we choose USB bulk-only(BBB) transport, the specification should be usbmassbulk_10.pdf.<span> <span class="Apple-converted-space"> </span></span>Let's have a<span> <span class="Apple-converted-space"> </span></span>look on it.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">This specification addresses Bulk-Only Transport, or in other words, transport of command, data, and status</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">occurring solely via Bulk endpoints (not via Interrupt or Control endpoints). This specification only uses the</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">default pipe to clear a STALL condition on the Bulk endpoints and to issue class-specific requests as defined</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">below. This specification does not require the use of an Interrupt endpoint.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">3.1.<span> <span class="Apple-converted-space"> </span></span>Bulk-Only Mass Storage Reset (class-specific request)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">This request is used to reset the mass storage device and its associated interface.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhZm4558N00fN0pum_xIn6ReHQWPp9KeTf5sutkoD7rmNpqUmqZ6Lv2hno16BCUxnVzEgaiCAN6f0IZPTLr4iCrQBDfB8PchgyD-M5mAlAfVAARFrhW_SYwcoOS6Bw91wrSuSTnuKHOTWw/s1600/image009.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhZm4558N00fN0pum_xIn6ReHQWPp9KeTf5sutkoD7rmNpqUmqZ6Lv2hno16BCUxnVzEgaiCAN6f0IZPTLr4iCrQBDfB8PchgyD-M5mAlAfVAARFrhW_SYwcoOS6Bw91wrSuSTnuKHOTWw/s1600/image009.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">3.2 Get Max LUN (class-specific request)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The device may implement several logical units that share common device characteristics.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhajAmtd2MpVJmDPvtVLdd3hqBUELEL9mp6X0EG9pHKxhu2p737BR4zd1qGNb61l_lB0T_ltr0oZnCCuINPxtodh-U5eRJ4sgw_c6AePdwCr9i6Yf2Wh02hEeoMHQRrGmew1FIG_f35h9Zn/s1600/image011.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhajAmtd2MpVJmDPvtVLdd3hqBUELEL9mp6X0EG9pHKxhu2p737BR4zd1qGNb61l_lB0T_ltr0oZnCCuINPxtodh-U5eRJ4sgw_c6AePdwCr9i6Yf2Wh02hEeoMHQRrGmew1FIG_f35h9Zn/s1600/image011.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">3.3. Host/Device Packet Transfer Order</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The host shall send the CBW before the associated Data-Out, and the device shall send Data-In after the</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">associated CBW and before the associated CSW. The host may request Data-In or CSW before sending the</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">associated CBW.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">If the dCBWDataTransferLength is zero, the device and the host shall transfer no data between the CBW and the</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">associated CSW.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">3.4. Command Queuing</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The host shall not transfer a CBW to the device until the host has received the CSW for any outstanding CBW.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">If the host issues two consecutive CBWs without an intervening CSW or reset, the device response to the second</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">CBW is indeterminate.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">3.5. Bi-Directional Command Protocol</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">This specification does not provide for bi-directional data transfer in a single command.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">3.6 Standard Descriptors</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Just get reference from Chapter 4, compare with Descriptors.c in demo code.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">3.7 Command/Data/Status Protocol</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">3.7.1 Command Block Wrapper (CBW)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The CBW shall start on a packet boundary and shall end as a short packet with exactly 31 (1Fh) bytes transferred.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6yWgDDrbPIuMtNjIdZwvZk_hUPmzEre2CQl2aEqB4h3CoBCUIWVujpvDQCn6QBln2x8MKqI2q1ogCRuFEbgMrVsJqvItPtydl75HGBPUBJ5V1mVup0D4qU8USkLuVtKfhVL-InxdDyqeo/s1600/image013.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6yWgDDrbPIuMtNjIdZwvZk_hUPmzEre2CQl2aEqB4h3CoBCUIWVujpvDQCn6QBln2x8MKqI2q1ogCRuFEbgMrVsJqvItPtydl75HGBPUBJ5V1mVup0D4qU8USkLuVtKfhVL-InxdDyqeo/s1600/image013.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">CBWCB:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>The command block to be executed by the device. The device shall interpret the first bCBWCBLength bytes in this field as a command block as defined by the command set identified by bInterfaceSubClass. If the command set supported by the device uses command blocks of fewer than 16 (10h) bytes in length, the significant bytes shall be transferred first, beginning with the byte at offset 15 (Fh). The device shall ignore the content of the CBWCB field past the byte at offset (15 + bCBWCBLength - 1).</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">3.7.2 Command Status Wrapper (CSW)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The CSW shall start on a packet boundary and shall end as a short packet with exactly 13 (0Dh) bytes transferred.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4kF2F8_thqTulTSnaDXIJlW1m19pHO-NfRLaMtRaGB5yD7py7A75kj3c-avODiT2YHhrQ8i77G6_d1afXCx21vl77yVd_QtieGN0ktZ7PrQK0z8R8VtadEgRkwSVjaQu1OsqQw5fiecCr/s1600/image015.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4kF2F8_thqTulTSnaDXIJlW1m19pHO-NfRLaMtRaGB5yD7py7A75kj3c-avODiT2YHhrQ8i77G6_d1afXCx21vl77yVd_QtieGN0ktZ7PrQK0z8R8VtadEgRkwSVjaQu1OsqQw5fiecCr/s1600/image015.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span><br /></span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">dCSWDataResidue:</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">For Data-Out the device shall report in the dCSWDataResidue the difference between the amount of data expected as stated in the dCBWDataTransferLength, and the actual amount of data processed by the device. For Data-In the device shall report in the dCSWDataResidue the difference between the amount of data expected as stated in the dCBWDataTransferLength and the actual amount of relevant data sent by the device. The dCSWDataResidue shall not exceed the value sent in the dCBWDataTransferLength.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">bCSWStatus:</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">bCSWStatus indicates the success or failure of the command. The device shall set this byte to zero if the command completed successfully. A non-zero value shall indicate a failure during command execution according to the<span> <span class="Apple-converted-space"> </span></span>following table:</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhZm4558N00fN0pum_xIn6ReHQWPp9KeTf5sutkoD7rmNpqUmqZ6Lv2hno16BCUxnVzEgaiCAN6f0IZPTLr4iCrQBDfB8PchgyD-M5mAlAfVAARFrhW_SYwcoOS6Bw91wrSuSTnuKHOTWw/s1600/image009.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb60NZeOM2ax2ia3KT9ZVOQj6efQ3D04_Dx_Z6bRvnN2tT92KIU9VdFaKUloK9lAr_kieBb3VSGypmV-izYv2aiyzuUag0lNHeb1z_LwaFE0UqpzqRDI7nnc80OOmrsR1clVB87_1KUeoV/s1600/image017.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb60NZeOM2ax2ia3KT9ZVOQj6efQ3D04_Dx_Z6bRvnN2tT92KIU9VdFaKUloK9lAr_kieBb3VSGypmV-izYv2aiyzuUag0lNHeb1z_LwaFE0UqpzqRDI7nnc80OOmrsR1clVB87_1KUeoV/s1600/image017.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">3.8. Host/Device Data Transfers</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">A Bulk-Only Protocol transaction begins with the host sending a CBW to the device and attempting to make the</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">appropriate data transfer (In, Out or none). The device receives the CBW, checks and interprets it, attempts to</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">satisfy the host's request, and returns status via a CSW.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Valid and Meaningful CBW</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The host communicates its intent to the device through the CBW. The device performs two verifications on</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">every CBW received. First, the device verifies that what was received is a valid CBW. Next, the device</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">determines if the data within the CBW is meaningful.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The device shall not use the contents of the dCBWTag in any way other than to copy its value to the dCSWTag of</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">the corresponding CSW.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Valid and Meaningful CSW</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The device generally communicates the results of its attempt to satisfy the host’s request through the CSW. The</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">host performs two verifications on every CSW received. First, the host verifies that what was received is a valid</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">CSW Next, the host determines if the data within the CSW is meaningful.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Error Handling and The Thirteen Cases</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Please refer 6.4 - 6.7 in usbmassbulk_10.pdf.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">SCSI command set</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">From configuration descriptors, we choose SCSI transparent command set. But What is the SCSI transparent command set? Refer to</span><a href="http://www.lvr.com/mass_storage_faq.htm" style="color: purple; text-decoration: underline;"><span style="color: #595959; font-family: Calibri, sans-serif; font-size: 9pt;">http://www.lvr.com/mass_storage_faq.htm</span></a><span style="color: #595959; font-family: Calibri, sans-serif; font-size: 9pt;">.</span><span style="font-family: Calibri, sans-serif;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">In the Mass Storage Class Specification Overview, Table 2.1 says that devices with subclass code 06h implement the "SCSI transparent command set." The SCSI specifications are available from t10.org, but these documents don't mention a transparent command set.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">According to the inventor of the subclass, subclass 06h means that the host should determine the device type by issuing a SCSI INQUIRY command. In the returned INQUIRY data, bits 4..0 of byte 0 specify a peripheral device type (PDT). The SCSI Primary Commands (SPC) specification defines various PDTs and the specifications they should comply with.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">New designs should use bInterfaceSubClass = 06h (SCSI transparent command set).</span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">The device's response to a SCSI INQUIRY command is then the single source where the device declares its command set (via the PERIPHERAL DEVICE TYPE (PDT) and VERSION codes).</span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"> </span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">What commands should my device support?</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">In the response to a SCSI INQUIRY command, a device returns a PERIPHERAL DEVICE TYPE code and a VERSION code. For hard drives, flash drives, and similar devices, PERIPHERAL DEVICE TYPE = 00h (direct access block device) and VERSION = 04h (SPC-2) or 05h (SPC-3). The code in the VERSION corresponds to a command set, and the command set's specification lists mandatory commands.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">So, we choose<b><span class="Apple-converted-space"> </span>SPC-2 (04h)</b>, not like 00h in LUFA mass storage demo code.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">4.1 SPC-2 specification.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Goto T10 org, found the documentation<span> <span class="Apple-converted-space"> </span></span></span><a href="http://www.t10.org/cgi-bin/ac.pl?t=f&f=spc2r20.pdf" style="color: purple; text-decoration: underline;"><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">http://www.t10.org/cgi-bin/ac.pl?t=f&f=spc2r20.pdf</span></a><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">,<span> <span class="Apple-converted-space"> </span></span>but it requires membership which I don't have. Google it and find below link works.<span class="Apple-converted-space"> </span></span><a href="http://www.13thmonkey.org/documentation/SCSI/spc2r20.pdf" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">http://www.13thmonkey.org/documentation/SCSI/spc2r20.pdf</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">4.2. Inquiry Command</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Let check Inquiry command definition in spc2r20.pdf. The INQUIRY command (see table 45) requests that information regarding parameters of the target and a component logical unit be sent to the application client.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPypL2ePEol2xHO3nzkWllxkPxWQ1aV3q1zSif5Ox7GGQlFlWcmm4SIVAaNsKYnxHnT_3cGB0ZNtu2I6o3qFCLknX_ZLliyqItVVZozFpvlWlifumfVbZBhye4vSnGHWswRleyALv51lOf/s1600/image019.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPypL2ePEol2xHO3nzkWllxkPxWQ1aV3q1zSif5Ox7GGQlFlWcmm4SIVAaNsKYnxHnT_3cGB0ZNtu2I6o3qFCLknX_ZLliyqItVVZozFpvlWlifumfVbZBhye4vSnGHWswRleyALv51lOf/s1600/image019.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">If both the EVPD and CMDDT bits are zero, the device server shall return the standard INQUIRY data .</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">When the EVPD bit is one, the PAGE OR OPERATION CODE field specifies which page of vital product data<span> <span class="Apple-converted-space"> </span></span>information the device server shall return.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLbPNOhjzXsAT5GuaE21SPdpb7GwWa3QWKOXsXmg_9DLfvgcC0VCJ6crVL58ERYdj6jEtaKcTts30M7J3peCf94L1ATGVLPOn5kGll12PMZ8vF5MNKzCtQHAUunJD6NBnWAuhA4-T1yoRi/s1600/image021.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLbPNOhjzXsAT5GuaE21SPdpb7GwWa3QWKOXsXmg_9DLfvgcC0VCJ6crVL58ERYdj6jEtaKcTts30M7J3peCf94L1ATGVLPOn5kGll12PMZ8vF5MNKzCtQHAUunJD6NBnWAuhA4-T1yoRi/s1600/image021.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14pt; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: black; font-family: Calibri, sans-serif; font-size: 10pt;">The Device type and Version:</span><span style="color: black; font-family: Calibri, sans-serif; font-size: 10pt;"></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdTgeumEJf3d7fuh6iG6rwSI-WF7aZG76su3EUcEHh8niV7gVWruHBOROUi2Yfsy_vjxQTUEK7-EGmEiPzgFUiKNUzO5rOvyD2rOuZNlFGGcU5K5J-5tNgk_qM-_9eP7OeMIV9LkIGeJHx/s1600/image023.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdTgeumEJf3d7fuh6iG6rwSI-WF7aZG76su3EUcEHh8niV7gVWruHBOROUi2Yfsy_vjxQTUEK7-EGmEiPzgFUiKNUzO5rOvyD2rOuZNlFGGcU5K5J-5tNgk_qM-_9eP7OeMIV9LkIGeJHx/s1600/image023.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLicWiz-W5-iZ8lMjV-EdM59Arwt75eirVk6z9fUbSy-ENsI_abtASWhkkVp800l-FL06Am5IAFbpuxygkTrH-wgpNlUGCq-wfGVV73kcDHczdsXNpOg9x0ERuxtEAfMtxcQz5ToH30qJ5/s1600/image025.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLicWiz-W5-iZ8lMjV-EdM59Arwt75eirVk6z9fUbSy-ENsI_abtASWhkkVp800l-FL06Am5IAFbpuxygkTrH-wgpNlUGCq-wfGVV73kcDHczdsXNpOg9x0ERuxtEAfMtxcQz5ToH30qJ5/s1600/image025.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Now we have done with Inquiry command.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">4.3.READ FORMAT CAPACITIES(23h)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">In practice, we got READ FORMAT CAPACITIES(23h) from Windows which don't defined in spc2 spec. Also no implemented by mass storage demo code. And code will stall the endpoint. Command 23h is READ FORMAT CAPACITIES in the Multimedia Commands (MMC) specification from t10.org. We can a little information in spc2r20.pdf.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUziFAPSPX1Utr3XlRsvv-zwTywf1ij-qNmAckL561SjkCidXiVZHSio1wD82t6621h8jk7PlfBlSn6FFTy73wwIwhq31F77XkKN3e0uplHM-O39-VOCaq6aa8wnpz2WUMwcltfQ3MYAzr/s1600/image027.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUziFAPSPX1Utr3XlRsvv-zwTywf1ij-qNmAckL561SjkCidXiVZHSio1wD82t6621h8jk7PlfBlSn6FFTy73wwIwhq31F77XkKN3e0uplHM-O39-VOCaq6aa8wnpz2WUMwcltfQ3MYAzr/s1600/image027.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">From above table, we can see READ FORMAT CAPACITIES belong to MMC-2</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Get reference from<span class="Apple-converted-space"> </span></span><a href="http://www.rockbox.org/wiki/pub/Main/DataSheets/mmc2r11a.pdf" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">http://www.rockbox.org/wiki/pub/Main/DataSheets/mmc2r11a.pdf</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The READ FORMAT CAPACITIES command (Table 271) allows the Initiator to request a list of the possible format capacities for an installed random-Writable media. This command also has the capability to report the capacity for a media when it is installed.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPE76FIpz2yiP_htThiEMuJ4w9qWjBXugALteL6LZrR_5r9tp24u8d7RI-i1S8PVne8W5BQ21PU7Uw2rKqdu4UmDCX2iCry4RQtbFH_hETml2wtIH4awGfMVMxo9JEezHrtT8bvKDTVTfH/s1600/image029.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPE76FIpz2yiP_htThiEMuJ4w9qWjBXugALteL6LZrR_5r9tp24u8d7RI-i1S8PVne8W5BQ21PU7Uw2rKqdu4UmDCX2iCry4RQtbFH_hETml2wtIH4awGfMVMxo9JEezHrtT8bvKDTVTfH/s1600/image029.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">4.4. SCSI Read 10 and Write 10 command</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">We won't find these two commands in spc2 spec, however, Windows indeed read/write removal disk by these two commands. We can get descriptions from below link.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a href="http://www.seagate.com/staticfiles/support/disc/manuals/Interface%20manuals/100293068c.pdf" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">http://www.seagate.com/staticfiles/support/disc/manuals/Interface%20manuals/100293068c.pdf</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The READ (10) command (see table 90) requests that the device server read the specified logical block(s) and</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">transfer them to the data-in buffer.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv7zsKktC9JucRPgf2_F_FnQwtcG10NOx92t8TsShuXx1TXSU-_z1eyXAQUDB6oEIXntNZhT_2Hd0ce6BZIlkPPw55Rv1poRGhajwY976lCfK9swyz4C4D3SYwcj8x10p5YUO94N-x9bej/s1600/image031.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv7zsKktC9JucRPgf2_F_FnQwtcG10NOx92t8TsShuXx1TXSU-_z1eyXAQUDB6oEIXntNZhT_2Hd0ce6BZIlkPPw55Rv1poRGhajwY976lCfK9swyz4C4D3SYwcj8x10p5YUO94N-x9bej/s1600/image031.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The WRITE (10) command (see table 189) requests that the device server transfer the specified logical</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">block(s) from the data-out buffer and write them.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh14hJ6N1_0x_KqBaIG1430pvs1wZbgOUCBoc7A5xgrZCatR7zbHH4nIq0CLK2INBKemF1qeaXS5WwmzCdeF9CgO48Tk_Uf9vfmxyHf7xx1HYrTAaT2_1KQfEMzEFrSPTZgxCBwBGsdT4j3/s1600/image033.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh14hJ6N1_0x_KqBaIG1430pvs1wZbgOUCBoc7A5xgrZCatR7zbHH4nIq0CLK2INBKemF1qeaXS5WwmzCdeF9CgO48Tk_Uf9vfmxyHf7xx1HYrTAaT2_1KQfEMzEFrSPTZgxCBwBGsdT4j3/s1600/image033.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">4.5 READ CAPACITY (10)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">This command also cannot find in SPC2 spec, and we can find it in</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a href="http://www.seagate.com/staticfiles/support/disc/manuals/Interface%20manuals/100293068c.pdf" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">http://www.seagate.com/staticfiles/support/disc/manuals/Interface%20manuals/100293068c.pdf</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">The READ CAPACITY (10) command (see table 108) requests that the device server transfer 8 bytes of parameter data describing the capacity and medium format of the direct-access block device to the data-in buffer.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSnbquZZg6emUZp252yBQ8KbYtpAA9therj-mrfcPgllYbEBVtoOYzQ0JdWhehZ62gSGUs5JNAg0sJ15Q7FqGsY91BW-kFetRu690TpOhmo-SS_bi1G_RuYHSCktA_k_q9og_-f-azk0Z6/s1600/image035.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSnbquZZg6emUZp252yBQ8KbYtpAA9therj-mrfcPgllYbEBVtoOYzQ0JdWhehZ62gSGUs5JNAg0sJ15Q7FqGsY91BW-kFetRu690TpOhmo-SS_bi1G_RuYHSCktA_k_q9og_-f-azk0Z6/s1600/image035.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">4.6 SCSI other commands</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>In SPC2 spec, we can find other SCSI commands.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">REQUEST SENSE(03h), MODE SENSE6(1Ah),TEST UNIT READY(00h),</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Modification in source code.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Now, we need implement all above into the USB mass storage demo. Of course, most of the protocol has been done. But it cannot run unless we make modifications.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">5.1. In SCSI.c,</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> </span>Change Inquiry data</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Change version from 0 to 4, which choose SPC-2. Also change strings of VendorID, ProductID, RevisionID.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Add page Inquiry data</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Add it for non-standard Inquiry request.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">static uint8_t Page_Inquiry_Data[] =</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>0x00,</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>0x00,</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>0x00,</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>0x00,</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>0x00</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">};</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Also modify SCSI_Command_Inquiry() to handle non-standard request.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Add SCSI_CMD_READ_FORMAT_CAPACITIES support.</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Add function to handle this command.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Add external global variables sector_count and sector_size which store SD card size and page size.</span><span lang="EN-US"></span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Change Read10 and Write10 function,</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Replace dataflash read/write with SD card read/write functions. Change the handle routine according the interrupt driven method.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">5.2 In Descriptors.c</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Change the VID/PID, and strings accordingly.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">5.3 In MassStorage.c</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Change hardware initialization function.</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">USB_Init(USB_DEVICE_OPT_FULLSPEED);</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Change USB CBW handler routine from polling mode to interrupt state driven</span><span lang="EN-US"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">void EVENT_USB_common_request(void) call from USB interrupt handler.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Symbol; font-size: 10pt;"><span>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Validation.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Build project, download firmware into SiM3U167 board. PC appear a disk icon. Right click on it, select format disk. It format successful.<span> </span>Read/Write large data, Read:400KBytes, Write:240KBytes. Capture the enumeration stage USB protocol.<span> </span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg-v8XEoYR9IaSNzLlHv1pCVB8JihctoDi15OuXZkvL5up0t3N3thUz4ZhjkDENGyySVQuPE-sVZl6bqTfh6XTEfjKaoC5cXl3F-wY1rqN_KXRhQv4vlGc99AnF9apGwXo_Oy2sdPdj4BJ/s1600/image037.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg-v8XEoYR9IaSNzLlHv1pCVB8JihctoDi15OuXZkvL5up0t3N3thUz4ZhjkDENGyySVQuPE-sVZl6bqTfh6XTEfjKaoC5cXl3F-wY1rqN_KXRhQv4vlGc99AnF9apGwXo_Oy2sdPdj4BJ/s1600/image037.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: -18pt; text-transform: none; vertical-align: middle; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"><span>7.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Source code</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0cm 0cm 0.0001pt 49.25pt; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;">Source code can be found from<span class="Apple-converted-space"> </span></span><a href="https://github.com/MarkDing/sim3sdk/tree/mass-storage" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">https://github.com/MarkDing/sim3sdk/tree/mass-storage</span></a></div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com2tag:blogger.com,1999:blog-6138180379582869534.post-47822702558254000932013-04-24T02:05:00.000-07:002013-04-24T02:05:58.693-07:00FATFs DMA support<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-SG</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";
mso-ansi-language:EN-SG;
mso-fareast-language:ZH-CN;}
</style>
<![endif]-->
<br />
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">We have request to
add DMA support in FATFs to improve SD read/write performance.</span></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l3 level1 lfo1; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Add DMA
descriptor structures in circurlar_buffer.c</span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"> +SI32_DMADESC_A_Type
dma_desc[SI32_DMACTRL_NUM_CHANNELS + SI32_DMADESC_ALT_STRIDE]<span style="mso-spacerun: yes;"> </span>__attribute__ ((aligned
SI32_DMADESC_PRI_ALIGN));</span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">15 +</span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">16 +</span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">17 +void
DMA_initialize(void)</span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">18 +{</span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">19 +<span style="mso-spacerun: yes;"> </span>// Setup and enable the DMA controller and
DMAXBAR</span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">20 +<span style="mso-spacerun: yes;"> </span>SI32_DMACTRL_A_write_baseptr(SI32_DMACTRL_0,
(uint32_t)dma_desc);</span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">21 +<span style="mso-spacerun: yes;">
</span>SI32_DMACTRL_A_enable_module(SI32_DMACTRL_0);</span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">22 +}</span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">23 +</span></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l2 level1 lfo2; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Enable DMA
clock and module in gCLKCTRL.c.</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">old new </span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">... ... @@
-44,5 +44,7 @@ void CLKCTRL_setup_default_mode_clock_gates(void)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">44 44 <span style="mso-spacerun: yes;">
</span>SI32_CLKCTRL_A_APBCLKG0_USB0 |</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">45 45 <span style="mso-spacerun: yes;">
</span>SI32_CLKCTRL_A_APBCLKG0_TIMER0 |</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">46 46 <span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>SI32_CLKCTRL_A_APBCLKG0_TIMER1
|</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .75in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">47 +<span style="mso-spacerun: yes;">
</span>SI32_CLKCTRL_A_APBCLKG1_MISC1 |</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">47 48 <span style="mso-spacerun: yes;">
</span>SI32_CLKCTRL_A_APBCLKG0_FLASHCTRL0);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .75in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">49 +<span style="mso-spacerun: yes;"> </span>SI32_CLKCTRL_A_enable_ahb_to_dma_controller(SI32_CLKCTRL_0);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">48 50
}</span></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l1 level1 lfo3; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Enable SPI
DMA configuration in gModes.c.</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">old new </span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">... ... @@
-38,8 +38,8 @@ void enter_default_mode_from_reset(void)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">38 38
</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">39 39 <span style="mso-spacerun: yes;"> </span>// Setup ports</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">40 40 <span style="mso-spacerun: yes;"> </span>pb_enter_default_mode_from_reset();</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">41 -<span style="mso-spacerun: yes;"> </span>gSPI0_enter_master_mode_config();</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">42 -</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .75in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">41 +<span style="mso-spacerun: yes;"> </span>//gSPI0_enter_master_mode_config();</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .75in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">42 +<span style="mso-spacerun: yes;"> </span>gSPI0_enter_dma_master_mode_config();</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">43 43 <span style="mso-spacerun: yes;"> </span>// Initialize clock control</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">44 44 <span style="mso-spacerun: yes;"> </span>SystemCoreClock = 20000000;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">45 45 <span style="mso-spacerun: yes;"> </span>cpu_update();</span></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l4 level1 lfo4; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Add DMA
operation in mmc.c</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">19 +#define
SPI_DMA_ENABLE</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">20 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">21 +#ifdef
SPI_DMA_ENABLE</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">22 +static
uint32_t rx_ch, tx_ch;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">23 +extern
SI32_DMADESC_A_Type dma_desc[SI32_DMACTRL_NUM_CHANNELS +
SI32_DMADESC_ALT_STRIDE];</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">24 +#endif</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">25 +#define
SPI_SLOW_SPEED 100000<span style="mso-spacerun: yes;"> </span>// 100K HZ</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">26 +#define
SPI_HIGH_SPEED 800000 <span style="mso-spacerun: yes;"> </span>// 8M Hz</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">27 /*
Port controls<span style="mso-spacerun: yes;"> </span>(Platform dependent) */</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">32 +#define FCLK_SLOW() SI32_SPI_A_write_clkrate(SI32_SPI_0,
APBCLK / (2 * SPI_SLOW_SPEED) -1) /* Set slow clock 100k Hz*/</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">33 +#define FCLK_FAST() SI32_SPI_A_write_clkrate(SI32_SPI_0,
APBCLK / (2 * SPI_HIGH_SPEED) -1) /* Set fast clock 8M Hz */</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">135
static void xmit_spi_multi(const BYTE *p,UINT cnt)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">136 {</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">137 +#ifdef
SPI_DMA_ENABLE</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">138 +<span style="mso-spacerun: yes;"> </span>uint32_t temp;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">139 +<span style="mso-spacerun: yes;"> </span>SI32_DMADESC_A_configure(&dma_desc[rx_ch],</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">140 +<span style="mso-spacerun: yes;"> </span>SI32_SPI_0_RX_ENDPOINT, &temp, cnt
/ 4, SI32_DMADESC_A_CONFIG_WORD_PIPE);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">141 +<span style="mso-spacerun: yes;">
</span>SI32_DMADESC_A_configure(&dma_desc[tx_ch],</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">142 +<span style="mso-spacerun: yes;"> </span>p, SI32_SPI_0_TX_ENDPOINT, cnt / 4,
SI32_DMADESC_A_CONFIG_WORD_TX);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">143 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">144 +<span style="mso-spacerun: yes;">
</span>SI32_DMACTRL_A_enable_channel(SI32_DMACTRL_0, rx_ch);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">145 +<span style="mso-spacerun: yes;">
</span>SI32_DMACTRL_A_enable_channel(SI32_DMACTRL_0, tx_ch);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">146 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">147 +<span style="mso-spacerun: yes;"> </span>// 6. Run the complete peripheral DMA cycle</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">148 +<span style="mso-spacerun: yes;"> </span>SI32_SPI_A_enable_dma_requests(SI32_SPI_0);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">149 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">150 +<span style="mso-spacerun: yes;">
</span>while(SI32_DMACTRL_A_read_chen(SI32_DMACTRL_0));</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">151 +#else</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">152 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">...</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">168
static void rcvr_spi_multi(BYTE *p,UINT cnt)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">169 {</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">170 +#ifdef
SPI_DMA_ENABLE</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">171 +<span style="mso-spacerun: yes;"> </span>uint32_t temp;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">172 +<span style="mso-spacerun: yes;">
</span>SI32_DMADESC_A_configure(&dma_desc[rx_ch],</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">173 +<span style="mso-spacerun: yes;"> </span>SI32_SPI_0_RX_ENDPOINT, p, cnt / 4,
SI32_DMADESC_A_CONFIG_WORD_RX);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">174 +<span style="mso-spacerun: yes;"> </span>SI32_DMADESC_A_configure(&dma_desc[tx_ch],</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">175 +<span style="mso-spacerun: yes;"> </span>&temp, SI32_SPI_0_TX_ENDPOINT, cnt
/ 4, SI32_DMADESC_A_CONFIG_WORD_PIPE);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">176 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">177 +<span style="mso-spacerun: yes;">
</span>SI32_DMACTRL_A_enable_channel(SI32_DMACTRL_0, rx_ch);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">178 +<span style="mso-spacerun: yes;">
</span>SI32_DMACTRL_A_enable_channel(SI32_DMACTRL_0, tx_ch);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">179 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">180 +<span style="mso-spacerun: yes;"> </span>// 6. Run the complete peripheral DMA cycle</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">181 +<span style="mso-spacerun: yes;"> </span>SI32_SPI_A_enable_dma_requests(SI32_SPI_0);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">182 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">183 +<span style="mso-spacerun: yes;">
</span>while(SI32_DMACTRL_A_read_chen(SI32_DMACTRL_0));</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">184 +#else</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">185
do {</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-left: 27.0pt; mso-list: l0 level1 lfo5; tab-stops: list .5in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">5.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Source code</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 27.0pt; margin-right: 0in; margin-top: 0in;">
<span lang="EN-SG"><a href="https://github.com/MarkDing/sim3sdk"><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt;">https://github.com/MarkDing/sim3sdk</span></a></span><span lang="EN-SG" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt;"></span></div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-72825135919893804172013-04-17T19:24:00.003-07:002013-04-17T19:24:57.298-07:00Three VCPs support <!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-SG</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";
mso-ansi-language:EN-SG;
mso-fareast-language:ZH-CN;}
</style>
<![endif]-->
<br />
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 8.2pt; margin-right: 0in; margin-top: 0in;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US;">Jussipo has made USB split mode enabled
and dual VCP work on his side. So I started looking into this issue, fixed two
defects and make three VCPs work. Here is the summary. </span></div>
<div class="MsoNormal" style="margin-left: 35.2pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in; text-indent: -.25in; vertical-align: middle;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: Arial;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Enable USB split mode</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US;">In src\LUFA\Drivers\USB\Core\SIM3u\Endpoint_SIM3U.c</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">... ... @@
-54,15 +54,15 @@ bool Endpoint_ConfigureEndpoint(const uint8_t Address,</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">54 54
</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">55 55
if(Number !=
ENDPOINT_CONTROLEP)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">56 56
{</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">57 - ep_config
= 0x450024; // bit 2,5,16,18,22 must be writen</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">58 -</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">57 + ep_config
= 0x450424;<span style="mso-spacerun: yes;"> </span>// bit 2,5,10,16,18,22 must
be written</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">58 + <span style="mso-spacerun: yes;"> </span>//IURF,ISTSTLI,SPLITEN,
OPRDYI,OORF,OSTSTLI</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">59 59
if(Type
== EP_TYPE_ISOCHRONOUS)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">60 60
{<span style="mso-spacerun: yes;"> </span>// ISO transfer need set "1"</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">61 61
ep_config
|= (SI32_USBEP_A_EPCONTROL_IISOEN_ISO_U32);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">62 62
}</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">63 63
if(dir_sel)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">64 64
{<span style="mso-spacerun: yes;"> </span>// IN endpoint</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">65 - ep_config
|= (SI32_USBEP_A_EPCONTROL_DIRSEL_IN_U32|SI32_USBEP_A_EPCONTROL_ICLRDT_RESET_U32);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">65 +<span style="mso-spacerun: yes;"> </span>ep_config |=
(SI32_USBEP_A_EPCONTROL_ICLRDT_RESET_U32);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">66 66
SI32_USBEP_A_set_in_max_packet_size(USB_EPn(Number),Size>>3);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">67 67
}</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">68 68
else</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-left: 35.2pt; mso-list: l0 level2 lfo2; tab-stops: list 1.0in; text-indent: -.25in; vertical-align: middle;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: Arial;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Make a function to
sent endpoint direction.</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US;">In
src\LUFA\Drivers\USB\Core\SIM3u\Endpoint_SIM3U.h</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">... ... @@
-591,7 +591,11 @@</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">591 591
static
inline void Endpoint_SetEndpointDirection(const uint32_t DirectionMask)
ATTR_ALWAYS_INLINE;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">592 592
static
inline void Endpoint_SetEndpointDirection(const uint32_t DirectionMask)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">593 593
{</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">594 - return;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">594 +<span style="mso-spacerun: yes;"> </span>if( DirectionMask ==
ENDPOINT_DIR_IN)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">595 +<span style="mso-spacerun: yes;">
</span>USB_EPn(usb_ep_selected)->EPCONTROL.DIRSEL = 1;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">596 +<span style="mso-spacerun: yes;"> </span>else</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">597 +<span style="mso-spacerun: yes;">
</span>USB_EPn(usb_ep_selected)->EPCONTROL.DIRSEL = 0;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">598 +<span style="mso-spacerun: yes;"> </span>return;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">595 599
}</span></div>
<div class="MsoNormal" style="margin-left: 35.2pt; mso-list: l0 level2 lfo3; tab-stops: list 1.0in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Add Endpoint_SetEndpointDirection() call in CDC
send/receive function</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US;">In src\LUFA\Drivers\USB\Class\Devcie\CDCClassDevice.c</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">old new </span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">... ... @@
-160,6 +160,7 @@ uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const
CDCInterfaceInfo,</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">160 160
if ((USB_DeviceState !=
DEVICE_STATE_Configured) ||
!(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">161 161
<span style="mso-spacerun: yes;"> </span>return ENDPOINT_RWSTREAM_DeviceDisconnected;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">162 162
</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">163 + Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">163 164
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">164 165
return
Endpoint_Write_Stream_LE(Buffer, Length, NULL);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">165 166
}</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">... ... @@
-249,6 +250,7 @@ int16_t CDC_Device_ReceiveByte(USB_ClassInfo_CDC_Device_t*
const CDCInterfaceInf</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">249 250
</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">250 251
int16_t ReceivedByte = -1;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">251 252
</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">253 + Endpoint_SetEndpointDirection(ENDPOINT_DIR_OUT);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">252 254
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpoint.Address);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">253 255
</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">254 256
if (Endpoint_IsOUTReceived())</span></div>
<div class="MsoNormal" style="margin-left: 35.2pt; mso-list: l0 level2 lfo4; tab-stops: list 1.0in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Prepared three individual INF files for one, two,
three VCPs </span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">Main modifications are list below.</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US;">In src\VirtualSerial\</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">88 +[DeviceList]</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">89 +%DESCRIPTION%=
DriverInstall,USB\VID_10C4&PID_A012&MI_00,
USB\VID_10C4&PID_A012&MI_02</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">90 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">91 +[DeviceList.NTamd64]</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">92 +%DESCRIPTION%=
DriverInstall,USB\VID_10C4&PID_A012&MI_00,
USB\VID_10C4&PID_A012&MI_02</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-left: 35.2pt; mso-list: l0 level2 lfo5; tab-stops: list 1.0in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">5.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Three VCP share same interrupt endpoint, and each BULK
in/out endpoint number is same since we use USB split mode.</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US;">In src\VirtualSerial\Descriptors.h</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">... ... @@
-40,15 +40,33 @@</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">40 40
#include
<lufa h="" rivers=""></lufa></span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">41 41
</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">42 42
/* Macros: */</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">43 +<span style="mso-spacerun: yes;"> </span>#define DUAL_VCP_ENABLE 1</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">44 +<span style="mso-spacerun: yes;"> </span>#define TRI_VCP_ENABLE<span style="mso-spacerun: yes;"> </span>0</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">45 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">43 46
/**
Endpoint address of the CDC device-to-host notification IN endpoint. */</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">44 47
#define
CDC_NOTIFICATION_EPADDR<span style="mso-spacerun: yes;">
</span>(ENDPOINT_DIR_IN<span style="mso-spacerun: yes;"> </span>| 1)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">45 48
</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">46 - /**
Endpoint address of the CDC device-to-host data IN endpoint. */</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">47 - #define
CDC_TX_EPADDR<span style="mso-spacerun: yes;">
</span>(ENDPOINT_DIR_IN<span style="mso-spacerun: yes;"> </span>| 2)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">49 +<span style="mso-spacerun: yes;"> </span>/** Endpoint address of the CDC1
device-to-host data IN endpoint. */</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">50 + #define
CDC1_TX_EPADDR<span style="mso-spacerun: yes;">
</span>(ENDPOINT_DIR_IN<span style="mso-spacerun: yes;"> </span>| 2)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">51 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">52 + /**
Endpoint address of the CDC1 host-to-device data OUT endpoint. */</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">53 + #define
CDC1_RX_EPADDR<span style="mso-spacerun: yes;">
</span>(ENDPOINT_DIR_OUT | 2)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">54 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">55 +#if
(DUAL_VCP_ENABLE || TRI_VCP_ENABLE)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">56 +<span style="mso-spacerun: yes;"> </span>/** Endpoint address of the CDC2
device-to-host data IN endpoint. */</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">57 +<span style="mso-spacerun: yes;"> </span>#define CDC2_TX_EPADDR<span style="mso-spacerun: yes;"> </span>(ENDPOINT_DIR_IN<span style="mso-spacerun: yes;"> </span>| 3)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">58 +</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">59 +<span style="mso-spacerun: yes;"> </span>/** Endpoint address of the CDC2
host-to-device data OUT endpoint. */</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">60 +<span style="mso-spacerun: yes;"> </span>#define CDC2_RX_EPADDR<span style="mso-spacerun: yes;"> </span>(ENDPOINT_DIR_OUT | 3)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">61 +#endif</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">48 62
</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">49 - /**
Endpoint address of the CDC host-to-device data OUT endpoint. */</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">50 - #define
CDC_RX_EPADDR<span style="mso-spacerun: yes;">
</span>(ENDPOINT_DIR_OUT | 3)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">63 +#if
(TRI_VCP_ENABLE)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">64 +<span style="mso-spacerun: yes;"> </span>/** Endpoint address of the CDC3
device-to-host data IN endpoint. */</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">65 +<span style="mso-spacerun: yes;"> </span>#define CDC3_TX_EPADDR<span style="mso-spacerun: yes;"> </span>(ENDPOINT_DIR_IN<span style="mso-spacerun: yes;"> </span>| 4)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">51 66
</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">67 +<span style="mso-spacerun: yes;"> </span>/** Endpoint address of the CDC3
host-to-device data OUT endpoint. */</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">68 +<span style="mso-spacerun: yes;"> </span>#define CDC3_RX_EPADDR<span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>(ENDPOINT_DIR_OUT | 4)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">69 +#endif</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-left: 35.2pt; mso-list: l0 level2 lfo6; tab-stops: list 1.0in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">6.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Add IAD, second and third VCP descriptions.</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">In src\VirtualSerial\Descriptors.c </span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">Here are part of modifications.</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">old new </span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">... ... @@
-47,15 +47,21 @@ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor =</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">47 47
{</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">48 48
.Header<span style="mso-spacerun: yes;"> </span>= {.Size =
sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">49 49
</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">50 - .USBSpecification<span style="mso-spacerun: yes;"> </span>= VERSION_BCD(01.10),</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">51 - .Class<span style="mso-spacerun: yes;"> </span>= CDC_CSCP_CDCClass,</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">52 - .SubClass<span style="mso-spacerun: yes;"> </span>= CDC_CSCP_NoSpecificSubclass,</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">53 - .Protocol<span style="mso-spacerun: yes;"> </span>= CDC_CSCP_NoSpecificProtocol,</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">50 +<span style="mso-spacerun: yes;"> </span>.USBSpecification<span style="mso-spacerun: yes;"> </span>= VERSION_BCD(02.00),</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">51 +<span style="mso-spacerun: yes;"> </span>.Class<span style="mso-spacerun: yes;"> </span>= USB_CSCP_IADDeviceClass,</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">52 +<span style="mso-spacerun: yes;"> </span>.SubClass<span style="mso-spacerun: yes;"> </span>= USB_CSCP_IADDeviceSubclass,</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">53 +<span style="mso-spacerun: yes;"> </span>.Protocol<span style="mso-spacerun: yes;"> </span>= USB_CSCP_IADDeviceProtocol,</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">54 54
</span></div>
<div class="MsoNormal" style="margin-left: 35.2pt; mso-list: l0 level2 lfo7; tab-stops: list 1.0in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">7.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Made other VCP works in main loop.</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">In src\VirtualSerial\VirtualSerial.c</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">87 150
</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">88 151
void VCOM_echo(void)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">89 152
{</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">90 - if(CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface))</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">153 + if(CDC_Device_BytesReceived(&VirtualSerial_CDC1_Interface))</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">91 154
{</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">92 - in_buff[0]
= CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">93 - CDC_Device_SendData(&VirtualSerial_CDC_Interface,
(char *)in_buff, 1);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">155 + in_buff[0]
= CDC_Device_ReceiveByte(&VirtualSerial_CDC1_Interface);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">156 + CDC_Device_SendData(&VirtualSerial_CDC1_Interface,
(char *)in_buff, 1);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">94 157
Endpoint_ClearIN();</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">95 158
}</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">159 +#if
(DUAL_VCP_ENABLE || TRI_VCP_ENABLE)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">160 + if(CDC_Device_BytesReceived(&VirtualSerial_CDC2_Interface))</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">161 + {</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">162 + in2_buff[0]
= CDC_Device_ReceiveByte(&VirtualSerial_CDC2_Interface);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">163 + CDC_Device_SendData(&VirtualSerial_CDC2_Interface,
(char *)in2_buff, 1);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">164 + Endpoint_ClearIN();</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">165 + }</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">166 +#endif</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">167 +#if
(TRI_VCP_ENABLE)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">168 +<span style="mso-spacerun: yes;">
</span>if(CDC_Device_BytesReceived(&VirtualSerial_CDC3_Interface))</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">169 +<span style="mso-spacerun: yes;"> </span>{</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">170 +<span style="mso-spacerun: yes;"> </span>in3_buff[0] =
CDC_Device_ReceiveByte(&VirtualSerial_CDC3_Interface);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">171 +<span style="mso-spacerun: yes;">
</span>CDC_Device_SendData(&VirtualSerial_CDC3_Interface, (char *)in3_buff,
1);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">172 +<span style="mso-spacerun: yes;"> </span>Endpoint_ClearIN();</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">173 +<span style="mso-spacerun: yes;"> </span>}</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">174 +#endif</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">96 175
}</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-left: 35.2pt; mso-list: l0 level2 lfo8; tab-stops: list 1.0in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">8.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Fix defect on handling zero package issue.</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US;">In
src\LUFA\Drivers\USB\Core\SIM3u\EndpointStream_SIM3U.c</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">... ... @@
-265,6 +265,13 @@ uint8_t Endpoint_Write_Stream_LE(const void* const Buffer,</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">265 265
{</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">266 266
count
= USB0_EP0_write_fifo(buf, Length);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">267 267
}</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">268 + if(Length
== ENDPOINT_CONTROLEP_DEFAULT_SIZE)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">269 + {</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">270 + SI32_USB_A_set_in_packet_ready_ep0(SI32_USB_0);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">271 + if
((ErrorCode = Endpoint_WaitUntilReady()) != ENDPOINT_READYWAIT_NoError)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">272 + <span style="mso-spacerun: yes;"> </span>return ErrorCode;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">273 + SI32_USB_A_set_in_packet_ready_ep0(SI32_USB_0);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">274 + }</span></div>
<div class="MsoNormal" style="margin-left: 35.2pt; mso-list: l0 level2 lfo9; tab-stops: list 1.0in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">9.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Fixed usb_ep_selected defect in USB ISR.</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US;">In
src\LUFA\Drivers\USB\Core\SIM3u\USBInterrupt_SIM3U.c</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">... ... @@
-103,7 +103,7 @@ void USB0_IRQHandler(void)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">103 103
<span style="mso-spacerun: yes;"> </span>USB0_ep0_handler();</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">104 104
<span style="mso-spacerun: yes;"> </span>return;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">105 105 <span style="mso-spacerun: yes;"> </span>}</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">106 -</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">106 +<span style="mso-spacerun: yes;"> </span>uint32_t ep_selected_backup =
usb_ep_selected;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">107 107 <span style="mso-spacerun: yes;"> </span>if (usbEpInterruptMask &
(SI32_USB_A_IOINT_IN1I_MASK | SI32_USB_A_IOINT_OUT1I_MASK))</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">108 108 <span style="mso-spacerun: yes;"> </span>{</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">109 109
<span style="mso-spacerun: yes;"> </span>Endpoint_SelectEndpoint(1);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">... ... @@
-124,7 +124,7 @@ void USB0_IRQHandler(void)</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">124 124
<span style="mso-spacerun: yes;"> </span>Endpoint_SelectEndpoint(4);</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">125 125
<span style="mso-spacerun: yes;"> </span>USB0_epn_handler();</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">126 126 <span style="mso-spacerun: yes;"> </span>}</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">127 -</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 62.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">127 +<span style="mso-spacerun: yes;"> </span>usb_ep_selected = ep_selected_backup;</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US;">128 128 <span style="mso-spacerun: yes;"> </span>// Handle Start of Frame Interrupt</span></div>
<div class="MsoNormal" style="margin-left: 35.2pt; mso-list: l0 level2 lfo10; tab-stops: list 1.0in; text-indent: -.25in; vertical-align: middle;">
<span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;">10.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Courier New"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman";">Source code</span></div>
<div style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 35.2pt; margin-right: 0in; margin-top: 0in;">
<span lang="EN-SG"><a href="https://github.com/MarkDing/sim3sdk"><span lang="EN-US" style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;">https://github.com/MarkDing/sim3sdk</span></a></span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US;"></span></div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-5910039828788084982013-01-03T22:20:00.001-08:002013-01-03T22:20:41.451-08:00Porting FatFs to SiM3U1xx<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;"><span>1.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span></b><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">Introduction</span></b></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>It has been one month since LUFA USB CDC worked. I was planning to add support USB mass storage device. I have to find storage media for testing. I have considered MCU internal RAM, Flash, they are too small to match my requirement. I need add SD as storage media. I have been looking around web to see whether there is an open source SD card device driver, and I found FatFS which is open source file system, and also contain a simple SD card SPI driver<span> <span class="Apple-converted-space"> </span></span>for other platforms.<span> <span class="Apple-converted-space"> </span></span>And my interesting had been changed to FatFS.<span> <span class="Apple-converted-space"> </span></span>It was well designed for embedded system and well implemented for several MCU platform. As we lack of FAT 12/16/32 support. I would like to port this file system in our SiM3U1xx platform. And of course, the SD card driver also supported by the way. It isn't too far from our original target, right? :-)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;"><span>2.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span></b><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">Background Knowledge</span></b></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>We have three parts need to understand well for starting our task. First is SD card knowledge, second is FAT , third is FatFs structure.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">2.1. SD card</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>For SD card background knowledge, I would like to introduce this article, I think it has told everything need to implement SD card driver.<span> <span class="Apple-converted-space"> </span></span></span><a href="http://elm-chan.org/docs/mmc/mmc_e.html" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">How to Use MMC/SDC</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;">.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">2.2. FAT</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>FAT was introduced by Microsoft. For long file name(LFN) support, we need to pay license fee to Microsoft. Or we can disable LFN function to avoid license fees.<span> <span class="Apple-converted-space"> </span></span>For FAT specification, it can be found in<span> <span class="Apple-converted-space"> </span></span></span><a href="http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">FAT32 Specification by Microsoft</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>(The reference document on FAT file system)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">2.3. FatFs</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>FatFs is a generic FAT file system module for small embedded systems. The FatFs is written in compliance with ANSI C and completely separated from the disk I/O layer. Therefore it is independent of hardware architecture. It can be incorporated into low cost microcontrollers, such as AVR, 8051, PIC, ARM, Z80, 68k and etc..., without any change.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>The official web site link below<span class="Apple-converted-space"> </span></span><a href="http://elm-chan.org/fsw/ff/00index_e.html" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">http://elm-chan.org/fsw/ff/00index_e.html</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;">. The latest FatFs version is R0.09a. It can be downloaded from<span class="Apple-converted-space"> </span></span><a href="http://elm-chan.org/fsw/ff/ff9a.zip" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">FatFs R0.09a</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;">.<span> <span class="Apple-converted-space"> </span></span>Also, it contains several sample projects which is mot benefit for us to start porting.<span> <span class="Apple-converted-space"> </span></span>Here is the link<span class="Apple-converted-space"> </span></span><a href="http://elm-chan.org/fsw/ff/ffsample.zip" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">FatFs sample projects</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>(AVR, PIC24, LPC2300, LPC1700, FM3, V850ES, H8/300H, SH-2A, RX62N, Win32 and Generic uC)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;"><span>3.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span></b><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">Hardware</span></b></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>We choose one SiM3U1xx<span> <span class="Apple-converted-space"> </span></span>MCU card, Audio I/O board and one mother board. Here is the photo of the hardware platform.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC-upthR_yNuhg7lL3qyLS3etxOMrQra2sQmx2hUPUiWVogojsbvgt7y3GRn9kieRs-g_Zyywad3CHSDcD1JdYthblEZEhncaDlblAlvorsC5WHtXvmS9vNUHO85AnfMOxC-PQYvY4cQwm/s1600/image001.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC-upthR_yNuhg7lL3qyLS3etxOMrQra2sQmx2hUPUiWVogojsbvgt7y3GRn9kieRs-g_Zyywad3CHSDcD1JdYthblEZEhncaDlblAlvorsC5WHtXvmS9vNUHO85AnfMOxC-PQYvY4cQwm/s1600/image001.jpg" /></a></div>
<br />
<br /><div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Audio I/O board and MCU card connection</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: none;"><tbody>
<tr><td style="border: 1pt solid rgb(163, 163, 163); padding: 4pt; width: 68.1pt;" valign="top" width="91"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SD pin</span></div>
</td><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: solid solid solid none; border-top-color: rgb(163, 163, 163); border-top-width: 1pt; padding: 4pt; width: 61pt;" valign="top" width="81"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">MCU card</span></div>
</td><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: solid solid solid none; border-top-color: rgb(163, 163, 163); border-top-width: 1pt; padding: 4pt; width: 82.85pt;" valign="top" width="110"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">I/O card</span></div>
</td></tr>
<tr><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-left-color: rgb(163, 163, 163); border-left-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid; padding: 4pt; width: 68.1pt;" valign="top" width="91"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">DAT3/CS</span></div>
</td><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid none; padding: 4pt; width: 61pt;" valign="top" width="81"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">PB0.8</span></div>
</td><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid none; padding: 4pt; width: 82.85pt;" valign="top" width="110"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SPI_NSS0_EZR</span></div>
</td></tr>
<tr><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-left-color: rgb(163, 163, 163); border-left-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid; padding: 4pt; width: 68.1pt;" valign="top" width="91"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">CMD/MOSI</span></div>
</td><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid none; padding: 4pt; width: 61pt;" valign="top" width="81"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">PB0.7</span></div>
</td><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid none; padding: 4pt; width: 82.85pt;" valign="top" width="110"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SPI_MOSI_EZR</span></div>
</td></tr>
<tr><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-left-color: rgb(163, 163, 163); border-left-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid; padding: 4pt; width: 68.1pt;" valign="top" width="91"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">CLK/SCLK</span></div>
</td><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid none; padding: 4pt; width: 61pt;" valign="top" width="81"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">PB0.5</span></div>
</td><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid none; padding: 4pt; width: 82.85pt;" valign="top" width="110"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SPI_SCK_EZR</span></div>
</td></tr>
<tr><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-left-color: rgb(163, 163, 163); border-left-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid; padding: 4pt; width: 68.1pt;" valign="top" width="91"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">DAT0/MISO</span></div>
</td><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid none; padding: 4pt; width: 61pt;" valign="top" width="81"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">PB0.6</span></div>
</td><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid none; padding: 4pt; width: 82.85pt;" valign="top" width="110"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SPI_MISO_EZR</span></div>
</td></tr>
<tr><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-left-color: rgb(163, 163, 163); border-left-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid; padding: 4pt; width: 68.1pt;" valign="top" width="91"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SW</span></div>
</td><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid none; padding: 4pt; width: 61pt;" valign="top" width="81"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">PB2.9</span></div>
</td><td style="border-bottom-color: rgb(163, 163, 163); border-bottom-width: 1pt; border-right-color: rgb(163, 163, 163); border-right-width: 1pt; border-style: none solid solid none; padding: 4pt; width: 82.85pt;" valign="top" width="110"><div style="font-family: 'Times New Roman', serif; font-size: 12pt; margin: 0in 0in 0.0001pt;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SD_SW</span></div>
</td></tr>
</tbody></table>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZFFaAQ5I6mzZ1qZbsspTJXR3l8H1AHdp58niWrP15HAXVigUJ9DEOOJXnAyDtdoRgg3x5JUHsOpVL-o1IbMRhv-Yiibb6vBFkwJpR45sOyR5PCOGkhblJmqPYMDtEzV9nUQruovP1FD0K/s1600/image003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZFFaAQ5I6mzZ1qZbsspTJXR3l8H1AHdp58niWrP15HAXVigUJ9DEOOJXnAyDtdoRgg3x5JUHsOpVL-o1IbMRhv-Yiibb6vBFkwJpR45sOyR5PCOGkhblJmqPYMDtEzV9nUQruovP1FD0K/s1600/image003.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span><br /></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;"><span>4.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span></b><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">Code Porting</span></b></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>We need to understand the structure of FatFS and implement low level communication SD card driver.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">4.1 FatFs structure</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>There is a<span class="Apple-converted-space"> </span></span><a href="http://elm-chan.org/fsw/ff/en/appnote.html" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">FatFs module application note</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>which is recommended to read first by Author. For my experience, we can go back to know more about FatFs after porting done.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">All files under FatFs directory like below.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">\ff9a\src\00readme.txt</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">\ff9a\src\diskio.c</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">\ff9a\src\diskio.h</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">\ff9a\src\ff.c</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">\ff9a\src\ff.h</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">\ff9a\src\ffconf.h</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">\ff9a\src\integer.h</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>It doesn't contain SD card low level driver but only file system. We can get SD card simple low level driver code from \ffsample\avr\mmc.c, replace diskio.c with mmc.c .</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">4.2 SD card driver porting</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">We need set correct GPIO pin as SPI, set SPI initial clock lower than 400Khz for SD card initialization requirement. And change the SPI communication code in mmc.c with SiM3U1xx SPI peripheral.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 11pt;">4.2.1 GPIO setting</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_PBSTD_A_set_pins_digital_input(SI32_PBSTD_0, 0x0040);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_PBSTD_A_set_pins_push_pull_output(SI32_PBSTD_0, 0x01A0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_PBSTD_A_write_pbskipen(SI32_PBSTD_0, 0x001F);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_PBCFG_A_enable_xbar0l_peripherals(SI32_PBCFG_0,</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_PBCFG_A_XBAR0L_SPI0EN |</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span><span> </span>SI32_PBCFG_A_XBAR0L_SPI0NSSEN);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_PBCFG_A_enable_crossbar_0(SI32_PBCFG_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_PBCFG_A_enable_crossbar_1(SI32_PBCFG_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 11pt;">4.2.2 SPI peripheral initialization</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_CLKCTRL_A_enable_apb_to_modules_0(SI32_CLKCTRL_0,</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span><span> </span>SI32_CLKCTRL_A_APBCLKG0_SPI0 |</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_CLKCTRL_A_APBCLKG0_FLASHCTRL0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> </span></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_SPI_A_select_4wire_master_mode_nss_high (SI32_SPI_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_SPI_A_write_clkrate(SI32_SPI_0, 0x00000040);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_SPI_A_set_data_length(SI32_SPI_0, 8);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_SPI_A_select_master_mode(SI32_SPI_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_SPI_A_enable_module(SI32_SPI_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_SPI_A_select_rx_fifo_threshold(SI32_SPI_0,<span> <span class="Apple-converted-space"> </span></span>SI32_SPI_FIFO_THRESHOLD_FOUR);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_SPI_A_select_tx_fifo_threshold(SI32_SPI_0,<span> <span class="Apple-converted-space"> </span></span>SI32_SPI_FIFO_THRESHOLD_FOUR);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 11pt;">4.2.3. SPI low level communication function</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>In mmc.c, we have couple of functions and macros need to be replaced.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="font-family: 'Courier New'; font-size: 11pt;">/* Port controls<span> <span class="Apple-converted-space"> </span></span>(Platform dependent) */</span></b><span style="font-family: 'Courier New'; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">#define CS_LOW() SI32_SPI_A_clear_nss (SI32_SPI_0) /* CS=low */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">#define CS_HIGH() SI32_SPI_A_set_nss (SI32_SPI_0) /* CS=high */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">#define SOCKINS true<span> <span class="Apple-converted-space"> </span></span>/* Card detected.<span> <span class="Apple-converted-space"> </span></span>yes:true, no:false, default:true */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">#define SOCKWP fales /* Write protected. yes:true, no:false, default:false */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="font-family: 'Courier New'; font-size: 11pt;">/* Exchange a byte */</span></b><span style="font-family: 'Courier New'; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">static BYTE xchg_spi(BYTE dat)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">SI32_SPI_A_write_tx_fifo_u8(SI32_SPI_0, dat);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">while(0 == SI32_SPI_A_is_shift_register_empty_interrupt_pending(SI32_SPI_0));</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">dat = (BYTE)SI32_SPI_A_read_rx_fifo_u8(SI32_SPI_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">return dat;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="font-family: 'Courier New'; font-size: 11pt;">/* Send a data block */</span></b><span style="font-family: 'Courier New'; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">static void xmit_spi_multi(const BYTE *p,UINT cnt)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">do {</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">SI32_SPI_A_write_tx_fifo_u8(SI32_SPI_0, *p++);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">while(0 == SI32_SPI_A_is_shift_register_empty_interrupt_pending(SI32_SPI_0));</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">SI32_SPI_A_write_tx_fifo_u8(SI32_SPI_0, *p++);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">while(0 == SI32_SPI_A_is_shift_register_empty_interrupt_pending(SI32_SPI_0));</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">} while (cnt -= 2);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_SPI_A_flush_rx_fifo(SI32_SPI_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_SPI_A_flush_tx_fifo(SI32_SPI_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="font-family: 'Courier New'; font-size: 11pt;">/* Receive a data block */</span></b><span style="font-family: 'Courier New'; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">static void rcvr_spi_multi(BYTE *p,UINT cnt)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">do {</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">SI32_SPI_A_write_tx_fifo_u8(SI32_SPI_0, 0xFF);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">while(0 == SI32_SPI_A_is_shift_register_empty_interrupt_pending(SI32_SPI_0));</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">*p++ = SI32_SPI_A_read_rx_fifo_u8(SI32_SPI_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">SI32_SPI_A_write_tx_fifo_u8(SI32_SPI_0, 0xFF);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">while(0 == SI32_SPI_A_is_shift_register_empty_interrupt_pending(SI32_SPI_0));</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">*p++ = SI32_SPI_A_read_rx_fifo_u8(SI32_SPI_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">} while (cnt -= 2);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_SPI_A_flush_rx_fifo(SI32_SPI_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>SI32_SPI_A_flush_tx_fifo(SI32_SPI_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="font-family: 'Courier New'; font-size: 11pt;">/* Wait for card ready<span> <span class="Apple-converted-space"> </span></span>*/</span></b><span style="font-family: 'Courier New'; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">static int wait_ready (void)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">BYTE d;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">uint32_t time_out;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">time_out = msTicks + 50; /* Wait for ready in timeout of 500ms */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">do</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">d = xchg_spi(0xFF);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">}while ((d != 0xFF) && (time_out > msTicks));</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">return (d == 0xFF) ? 1 : 0;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">OK we are done with porting job, now let start with test.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;"><span>5.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span></b><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">Function verify</span></b></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>We prepare simple file system test sequence. First, we read one file from SD card and print part of contents, , here we have "test.abp"; Second, we create a hello.txt file and put "Hello world!" in it; Third, we make a root directory list, it should show all files under root directory.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">void fatfs_test()</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">FRESULT rc; /* Result code */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">DIR dir; /* Directory object */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">FILINFO fno; /* File information object */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">UINT bw, br, i;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">f_mount(0, &Fatfs); /* Register volume work area (never fails) */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">printf("\nOpen an existing file (test.abp).\n");</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">rc = f_open(&Fil, "TEST.ABP", FA_READ);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">if (rc) die(rc);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">printf("\nType the file content.\n");</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">//for (;;)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">do</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">rc = f_read(&Fil, Buff, sizeof Buff, &br); /* Read a chunk of file */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">if (rc || !br) break; /* Error or end of file */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">for (i = 0; i < br/4; i++) /* Type the data */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 81pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">putchar(Buff[i]);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">}while(0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">if (rc) die(rc);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">printf("\nClose the file.\n");</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">rc = f_close(&Fil);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">if (rc) die(rc);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">printf("\nCreate a new file (hello.txt).\n");</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">rc = f_open(&Fil, "HELLO.TXT", FA_WRITE | FA_CREATE_ALWAYS);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">if (rc) die(rc);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">printf("\nWrite a text data. (Hello world!)\n");</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">rc = f_write(&Fil, "Hello world!\r\n", 14, &bw);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">if (rc) die(rc);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">printf("%u bytes written.\n", bw);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">printf("\nClose the file.\n");</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">rc = f_close(&Fil);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">if (rc) die(rc);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">printf("\nOpen root directory.\n");</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">rc = f_opendir(&dir, "");</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">if (rc) die(rc);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">printf("\nDirectory listing...\n");</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">for (;;) {</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">rc = f_readdir(&dir, &fno); /* Read a directory item */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">if (rc || !fno.fname[0]) break; /* Error or end of dir */</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">if (fno.fattrib & AM_DIR)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 81pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">printf("<span> <span class="Apple-converted-space"> </span></span><dir><span> <span class="Apple-converted-space"> </span></span>%s\n", fno.fname);</dir></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">else</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 81pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">printf("%8lu<span> <span class="Apple-converted-space"> </span></span>%s\n", fno.fsize, fno.fname);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">if (rc) die(rc);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">printf("\nTest completed.\n");</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">while(1);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Here is the output of the test:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">******************************************</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;">Open an existing file (test.abp).</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;">Type the file content.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;">\357\273\277</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;">Close the file.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;">Create a new file (hello.txt).</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;">Write a text data. (Hello world!)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;">14 bytes written.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;">Close the file.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;">Open root directory.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;">Directory listing...</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;"><span> <span class="Apple-converted-space"> </span></span>540011<span> <span class="Apple-converted-space"> </span></span>TEST.ABP</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;"><span> <span class="Apple-converted-space"> </span></span>14<span> <span class="Apple-converted-space"> </span></span>HELLO.TXT</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 9pt;">Test completed.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">********************************************</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">OK, The test result shows file system works very well. We have done the porting job. Cheers!</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;"><span>6.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></span></b><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">Source code</span></b></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span> <span class="Apple-converted-space"> </span></span>Source code can be found in<span class="Apple-converted-space"> </span></span><a href="https://github.com/MarkDing/fatfs" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">https://github.com/MarkDing/fatfs</span></a></div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com1tag:blogger.com,1999:blog-6138180379582869534.post-30895172651736293922012-12-07T01:50:00.000-08:002013-02-19T19:15:01.186-08:00Write USB CDC driver for SiM3U1xx<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 17pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">1.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></b><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">Introduction</span></b></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>We are talking about how to write a USB CDC driver in Silabs Arm Cortex M3 MCU. CDC class will simulate a COM port in PC OS which can be accessed by common serial tool. The chip we are using is SiM3U1xx. We can go through USB basic knowledge and then into detail design method to make it work on SiM3U167. USB device driver used be hard part due to limited PC OS driver support and firmware need to take care many electric layer operations. But now, PC support more and more USB classes by default. We don't need to write PC driver. And SOC with USB component make it easier to manage USB transfer behavior. We can focus on protocol layer, that is really benefit for us to write a USB driver. In this case, USB CDC device is supported by WinXP, Win7,etc. and only need one INF file. So let us start it to learn how to make it look simple.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">2.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></b><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">USB background knowledge</span></b></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>Universal Serial Bus (USB) is an industry standard developed in the mid-1990s that defines the cables, connectors and communications protocols used in a bus for connection, communication and power supply between computers and electronic devices. USB interface include VBUS, GND, D+,D-.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">2.1. <span class="Apple-converted-space"> </span>History</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>There are three USB specifications. USB1.1, USB2.0, USB3.0.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB1.1 released in January 1998, USB 1 specified data rates of<span class="Apple-converted-space"> </span><i>1.5 Mbit/s</i><span class="Apple-converted-space"> </span>(<i>Low-Bandwidth</i>) and<span class="Apple-converted-space"> </span><i>12 Mbit/s</i><span class="Apple-converted-space"> </span>(<i>Full-Bandwidth</i>)</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB2.0 Released in April 2000. Added higher maximum signaling rate of<span class="Apple-converted-space"> </span><i>480 Mbit/s</i><span class="Apple-converted-space"> </span>(effective throughput up to 35 MB/s or 280 MBit/s) (now called<span class="Apple-converted-space"> </span><i>"Hi-Speed"</i>).</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB3.0 was released in November 2008. The standard claims a theoretical "maximum" transmission speed of up to 5 Gbit/s (625 MB/s). USB 3.0 reduces the time required for data transmission, reduces power consumption, and is backward compatible with USB 2.0.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">2.2 System design.</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>The design architecture of USB is asymmetrical in its topology, consisting of a host, a multitude of downstream USB ports, and multiple peripheral devices connected in a tiered-star topology. <span class="Apple-converted-space"> </span>Up to 127 devices, including hub devices if present, may be connected to a single host controller.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>USB device communication is based on pipes (logical channels). A pipe is a connection from the host controller to a logical entity, found on a device, and named an endpoint. Because pipes correspond 1-to-1 to endpoints, the terms are sometimes used interchangeably. A USB device can have up to 32 endpoints. </span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>There are two types of pipes: stream and message pipes. A message pipe is bi-directional and is used for control transfers. Message pipes are typically used for short, simple commands to the device, and a status response, used, for example, by the bus control pipe number 0. A stream pipe is a uni-directional pipe connected to a uni-directional endpoint that transfers data using an isochronous, interrupt, or bulk transfer:</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">isochronous transfers</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">: at some guaranteed data rate (often, but not necessarily, as fast as possible) but with possible data loss (e.g., realtime audio or video).</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">interrupt transfers</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">: devices that need guaranteed quick responses (bounded latency) (e.g., pointing devices and keyboards).</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">bulk transfers</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">: large sporadic transfers using all remaining available bandwidth, but with no guarantees on bandwidth or latency (e.g., file transfers).</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>An endpoint of a pipe is addressable with a tuple (device_address, endpoint_number) as specified in a TOKEN packet that the host sends when it wants to start a data transfer session. If the direction of the data transfer is from the host to the endpoint, an OUT packet (a specialization of a TOKEN packet) having the desired device address and endpoint number is sent by the host. If the direction of the data transfer is from the device to the host, the host sends an IN packet instead.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>Endpoints are grouped into interfaces and each interface is associated with a single device function. An exception to this is endpoint zero, which is used for device configuration and which is not associated with any interface. A single device function composed of independently controlled interfaces is called a composite device. A composite device only has a single device address because the host only assigns a device address to a function.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> </span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>When a USB device is first connected to a USB host, the USB device enumeration process is started. The enumeration starts by sending a reset signal to the USB device. The data rate of the USB device is determined during the reset signaling. After reset, the USB device's information is read by the host and the device is assigned a unique 7-bit address. If the device is supported by the host, the device drivers needed for communicating with the device are loaded and the device is set to a configured state. If the USB host is restarted, the enumeration process is repeated for all connected devices.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">2.3 Device classes</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>The functionality of USB devices is defined by class codes, communicated to the USB host to affect the loading of suitable software driver modules for each connected device. This provides for adaptability and device independence of the host to support new devices from different manufacturers.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Device classes include:</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivRes4x5299Tnw_Cxnj75ypyXbt2cum28M-gXCDwlu9eV1JHcSO80oIBY448mG8lQK6IrRGZd5y9wljln4yb3mLbvbmM4kRTuw_4coxl29ZD7UrDz3EZbRI25vJMq1DoT8OkZw-A6JqY55/s1600/image001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivRes4x5299Tnw_Cxnj75ypyXbt2cum28M-gXCDwlu9eV1JHcSO80oIBY448mG8lQK6IrRGZd5y9wljln4yb3mLbvbmM4kRTuw_4coxl29ZD7UrDz3EZbRI25vJMq1DoT8OkZw-A6JqY55/s1600/image001.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="color: #17365d;"><span style="font-family: Symbol;"><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">3.</span></b> </span></span><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">USB protocol</span></b></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">For USB 2.0 high speed device. There is a pull up resistor on D+. On USB host side, D+/D- has pull down resistors. Once USB device plug in, USB host find D+ voltage rise up, and then know USB device attached. USB host will execute a bus reset, and assign an address for this USB device. And then USB host want to get detail information of USB device. Know device class type, assign correspond class driver for this device for further communication. We can separate it into two stages: enumeration and class stage communication.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>Every packet transfer need ACK/NACK indicate status. Once host send a packet, it will show it is IN or OUT packet type. Here IN means host in, OUT means host out. For IN type, device should prepare data in IN endpoint and response NACK if data not ready, once data ready, sent it out and get ACK from host. For OUT type, device should response with ACK when data received. This is easy understand, just like handshake in any reliable communication.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">3.1 Enumeration.</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>In this stage, USB host try to get essential information of USB device by a set of descriptors. Detail description can be found in USB 2.0 specification chapter 9. Let's see a capture snapshot of USB enumeration status by USB protocol analyzer.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSEOzvYZa24pMfbBfgFWBsSaRWMB9zBcLeGXuUqrSgZR_WVSgAbNqXyM8GWMEKBqU7Vtxn4F0adGmh6FI_1K13L0aWRmlx32SbB1nTdUI7yZQDFT5T1rlflBsbNhhS7g0l8olG3V7s_6vV/s1600/image003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSEOzvYZa24pMfbBfgFWBsSaRWMB9zBcLeGXuUqrSgZR_WVSgAbNqXyM8GWMEKBqU7Vtxn4F0adGmh6FI_1K13L0aWRmlx32SbB1nTdUI7yZQDFT5T1rlflBsbNhhS7g0l8olG3V7s_6vV/s1600/image003.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>From above snapshot. Let's start with row 5 "Reset(15.0ms)".We can see PC execute a Bus Reset at first. And execute High speed Detection Handshake, this one to get know is high speed or full speed device. In our case, it is TIMEOUT which means it is full speed device. </span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">3.1.1 <span class="Apple-converted-space"> </span>After that, USB host assign an address to device with SetAddress command. The command package is 8 bytes size, we call it Setup data, the structure illustrate in USB2.0 spec chapter 9.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUo1PuqB0omUj5YTNzUluz3SvRKWUlrqMlj1zh0GGwkleyoKPQre-TktUdPwDcKYZvjPpl8FrJDgaGwLPE09_XxhP_UOt16XhXy8xen_YH4GKLBtKVGqpHbjxTJVBwFMALyHs3yK-HeFeh/s1600/image005.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUo1PuqB0omUj5YTNzUluz3SvRKWUlrqMlj1zh0GGwkleyoKPQre-TktUdPwDcKYZvjPpl8FrJDgaGwLPE09_XxhP_UOt16XhXy8xen_YH4GKLBtKVGqpHbjxTJVBwFMALyHs3yK-HeFeh/s1600/image005.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKwlFxT8yxBTeX1Cyc_QlW60u0mQI2yJ-SgAcgHXUZkcTdShW5qlyCE3Bh55tE97AvN6l_H7Epfg0cLCSSB-F5_EMuTc9PtPHZazYQKzXGrO4x6zPBMYfTSxnU5qj0f6BIR26xaJc3DcNN/s1600/image029.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Let's have a look on SetAddress command, the data is 00, 05,05,00,00,00,00,00.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">So we got bmRequestType = 00, <span class="Apple-converted-space"> </span>Host-to-device direction; standard type; device recipient.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4qIhvq6vnunXE20jq5SxhgBI8QB_-WaAnzWOHxd5FVlxhip2M6vskHAW3Y3uF5WHdVbgk3wO1Zl4E7L7nPjZIbKa_E2sCA0c1bxSxt6atzF8vOdP3AzOE_MTxPxRu0Djdxyd7tLrYhjMs/s1600/image007.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4qIhvq6vnunXE20jq5SxhgBI8QB_-WaAnzWOHxd5FVlxhip2M6vskHAW3Y3uF5WHdVbgk3wO1Zl4E7L7nPjZIbKa_E2sCA0c1bxSxt6atzF8vOdP3AzOE_MTxPxRu0Djdxyd7tLrYhjMs/s1600/image007.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
</div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">bRequest = 05, it is <span class="Apple-converted-space"> </span>Set_Address refer to Table 9-4</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinoS-aMmy9f4WXNWbyuVAi4Faa7geT5t5qug0OBkPsx7k1Gh5IzVZMihhbuqL2kp3a-lWICQcgWvzbG5iVREAqEtqZ9HY_sEI99tsE_ZHgPu1KTPVTnhwNYmNsbddW7_CiAMn1pVSWycP6/s1600/image009.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinoS-aMmy9f4WXNWbyuVAi4Faa7geT5t5qug0OBkPsx7k1Gh5IzVZMihhbuqL2kp3a-lWICQcgWvzbG5iVREAqEtqZ9HY_sEI99tsE_ZHgPu1KTPVTnhwNYmNsbddW7_CiAMn1pVSWycP6/s1600/image009.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">wValue = 0005(LSB), this is assgigned address = 5.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">wIndex = 0000(LSB), it is zero refer Table 9-3.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">wLenght = 0000(LSB), it s zeron refer Table 9-3.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Once device set address correctly, it ACK to USB host to indicate address assignment was done.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">3.1.2. <span class="Apple-converted-space"> </span>And USB host send a GetDescriptor setup data to know detail description of device. Let's have a look on the setup data. 80,06,00,01,00,00,12,00</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">bmRequestType = 0x80, device to host direction, <span class="Apple-converted-space"> </span>that mean device need to send back data to host.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">bRequest <span class="Apple-converted-space"> </span>= 06, GetDescriptor command refer Table 9-4.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">wValue = 0001(LSB), Descriptor type is device refer Table 9-5.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizb_vkM-86W3O_SQgmQo4O7jWUhoukwVF0uYHrTZFW05rINVf4ZMHsniJR2icTLMaBFQI9JOeESxBHopZl_dnHPhFYz6HZiyrsFMWd7Jj2BcLNBTULM3KM98_1X7QZamMc0MzuU4OLkEoq/s1600/image011.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizb_vkM-86W3O_SQgmQo4O7jWUhoukwVF0uYHrTZFW05rINVf4ZMHsniJR2icTLMaBFQI9JOeESxBHopZl_dnHPhFYz6HZiyrsFMWd7Jj2BcLNBTULM3KM98_1X7QZamMc0MzuU4OLkEoq/s1600/image011.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">wIndex = 0000(LSB), it is zero refer Table 9-3.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">wLenght = 0x0012(LSB), <span class="Apple-converted-space"> </span>descriptor length is 18 bytes.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">And then we can device send back 18 bytes descriptors (12,01,10,01,02,00,00,40,c4,10,02,a0,01,00,01,02,00,01), the data structure also can be found in chapter 9 Table 9-8. Standard Device Descriptor. Let's have good looking formation of these data.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhShp97LDFlwfATxz_wuEXhm-O_zJQ6qgHxxb4nbdDuNrCHxnAaPz2W-MzMY2U6aOQuaYnfnE34GZh2IuA5PxzH_PgkT2JenwJ6gEuMlwc9tzvhu-1lBZS7P7r1ZjeBb471qhM0Sb6X0iYJ/s1600/image013.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhShp97LDFlwfATxz_wuEXhm-O_zJQ6qgHxxb4nbdDuNrCHxnAaPz2W-MzMY2U6aOQuaYnfnE34GZh2IuA5PxzH_PgkT2JenwJ6gEuMlwc9tzvhu-1lBZS7P7r1ZjeBb471qhM0Sb6X0iYJ/s1600/image013.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">The idVendor is fix, 0x10c4 for Silabs, idProduct 0xa002 which need customer to ask Silabs assign an unique PID for them. bDeviceClass = 2 means CDC class. And others items are easy to understand, not to talk in detail.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">3.1.3. And then USB host execute GetDescriptor(Configuration),GetDescriptor(Sting LangIDs),GetDescriptor(String iProduct),SetConfiguration(1). Those can be found in USB2.0 spec chapter 9 also. Then enumeration was done.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">3.2 Class stage communication.</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">We can see last two setup data was CDC class special command. Class special IN(0x21) and Class Special Out(0x22). We need to get detail information from class CDC spec usbcdc11.pdf. <span class="Apple-converted-space"> </span>0x21 is GET_LINE_CODING, 0x22 is SET_CONTROL_LINE_STATE.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeYYUME-wq6gLvoBt6rELZ60SX8iU8zYo_-MUvpI2wYhUF_CUkZeEDAA4REaP7wMyIZoULK6JO6fXUqVv2HWgxUJHVqLOlILWv4CRqpGop8od6zrDL55J3dsT6n_BRMYoum2bjruo7Iddq/s1600/image015.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeYYUME-wq6gLvoBt6rELZ60SX8iU8zYo_-MUvpI2wYhUF_CUkZeEDAA4REaP7wMyIZoULK6JO6fXUqVv2HWgxUJHVqLOlILWv4CRqpGop8od6zrDL55J3dsT6n_BRMYoum2bjruo7Iddq/s1600/image015.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
</div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">All above are endpoint 0 transfer. For CDC ACM USB class, we need on interrupt in endpoint, one bulk in endpoint, one bulk out endpoint. So let's capture some data when open USB CDC device, and data transfer.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTFVFuS-Mlpqd5ZRUNWLCsprs_hFVkaLwYdA_6p_HM32s0zpFXyFmIgyHR2x9_nSl6c3Flf2_uHJlVBeGdYldCJ3EQOG89HxH60llocv2lDY3ELtno59pJ3tqJEWUYzcERAVNgK5mWBlwG/s1600/image017.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTFVFuS-Mlpqd5ZRUNWLCsprs_hFVkaLwYdA_6p_HM32s0zpFXyFmIgyHR2x9_nSl6c3Flf2_uHJlVBeGdYldCJ3EQOG89HxH60llocv2lDY3ELtno59pJ3tqJEWUYzcERAVNgK5mWBlwG/s1600/image017.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">We can see at first USB host send GET_LINE_CODING(0x21) command to learn device status, <span class="Apple-converted-space"> </span>device report 0x1c200(LSB), 115200 bps, 8 data bits, 1 stop bit, no parity. But we set BPS as 57600 in UART terminal tool, so we see SET_LINE_CODING(0X20) send 0xE100 to device and read back for comparison. <span class="Apple-converted-space"> </span>Also, we capture data in bulk endpoint in/out, there is 'a' (0x61) in OUT endpoint(3), 'b'(0x62) in IN endpoint(2).</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="color: #17365d; font-family: Symbol; font-size: 10pt;"><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">4</span></b>·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">Write USB CDC device driver</span></b></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>Now we are going to start programming. As we discuss above, the first thing is handle Setup Data in code; Second thing is handle Class special request; Last thing is realize function requirement. <span class="Apple-converted-space"> </span>Of course, hardware initialization has to be done before USB run.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">4.1 Hardware initialization.</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Enable APB clock to PB0, UART0, USB0, FLASH module</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_CLKCTRL_A_enable_apb_to_modules_0(SI32_CLKCTRL_0,</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span> SI32_CLKCTRL_A_APBCLKG0_PB0 |</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_CLKCTRL_A_APBCLKG0_UART0 |</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_CLKCTRL_A_APBCLKG0_USB0 |</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_CLKCTRL_A_APBCLKG0_FLASHCTRL0);</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Set flash access speed to 2 for 48Mhz system clock.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_FLASHCTRL_A_select_flash_speed_mode(SI32_FLASHCTRL_0, 2);</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">GPIO setup, SMV enable, PB2 for LED as push-pull,Crossbar0,1 enable, <span class="Apple-converted-space"> </span>UART pin module enabled.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_PBSTD_A_set_pins_push_pull_output(SI32_PBSTD_1, 0x0008);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_PBSTD_A_write_pbskipen(SI32_PBSTD_1, 0x0008);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_PBCFG_A_enable_crossbar_0(SI32_PBCFG_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_PBCFG_A_enable_crossbar_1(SI32_PBCFG_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_PBSTD_A_set_pins_push_pull_output(SI32_PBSTD_2, 0x00000C00);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>// UART PINS TO PROPER CONFIG (TX = PB1.12, RX = PB1.13)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_PBSTD_A_set_pins_push_pull_output(SI32_PBSTD_1, 0x0001000);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_PBSTD_A_set_pins_digital_input(SI32_PBSTD_1, 0x00002000);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_PBSTD_A_write_pbskipen(SI32_PBSTD_0, 0x0000FFFF);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_PBSTD_A_write_pbskipen(SI32_PBSTD_1, 0x00000FFF);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_PBCFG_A_enable_xbar0h_peripherals(SI32_PBCFG_0, SI32_PBCFG_A_XBAR0H_UART0EN);</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Enable USB oscillator, set AHB source as USB oscillator, and system clock as 48Mhz.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_USB_A_enable_usb_oscillator(SI32_USB_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SI32_CLKCTRL_A_select_ahb_source_usb_oscillator(SI32_CLKCTRL_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>SystemCoreClock = 48000000;</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">UART hardware initialize and interrupt enable</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_set_rx_baudrate(SI32_UART_0, (SystemCoreClock / (2 * 115200)) - 1);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_set_tx_baudrate(SI32_UART_0, (SystemCoreClock / (2 * 115200)) - 1);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">// SETUP TX (8-bit, 1stop, no-parity)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_select_tx_data_length(SI32_UART_0, 8);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_enable_tx_start_bit(SI32_UART_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_enable_tx_stop_bit(SI32_UART_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_disable_tx_parity_bit(SI32_UART_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_select_tx_stop_bits(SI32_UART_0, SI32_UART_A_STOP_BITS_1_BIT);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_enable_tx(SI32_UART_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">// SETUP RX</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_select_rx_data_length(SI32_UART_0, 8);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_enable_rx_start_bit(SI32_UART_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_enable_rx_stop_bit(SI32_UART_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_disable_rx_parity_bit(SI32_UART_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_select_rx_stop_bits(SI32_UART_0, SI32_UART_A_STOP_BITS_1_BIT);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_select_rx_fifo_threshold_1(SI32_UART_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_enable_rx(SI32_UART_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_UART_A_enable_rx_data_request_interrupt(SI32_UART_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">NVIC_ClearPendingIRQ(UART0_IRQn);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">NVIC_EnableIRQ(UART0_IRQn);</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB hardware initialize and interrupt enable</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_USB_A_reset_module (SI32_USB_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">// Enable Endpoint 0 interrupts</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_USB_A_write_cmint (SI32_USB_0, 0x00000000);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_USB_A_write_ioint (SI32_USB_0, 0x00000000);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_USB_A_enable_ep0_interrupt (SI32_USB_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB_DeviceState <span class="Apple-converted-space"> </span>= DEVICE_STATE_Unattached;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB_Device_ConfigurationNumber <span class="Apple-converted-space"> </span>= 0;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB_Device_SetFullSpeed();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_USB_A_enable_suspend_interrupt (SI32_USB_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_USB_A_enable_reset_interrupt (SI32_USB_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">NVIC_EnableIRQ(USB0_IRQn);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 4.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB_DeviceState = DEVICE_STATE_Powered;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">// Uninhibit the module once all initialization is complete</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_USB_A_enable_module(SI32_USB_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 4.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span> SI32_USB_A_enable_internal_pull_up(SI32_USB_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">4.2 USB Setup data handler.</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">There is a default USB ISR entry "void USB0_IRQHandler(void)", we put ep0 handler in this entry. </span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Interrupt handle</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Once enter ISR, we clear interrupt flag, and check whether it is EP0 interrupt, and jump to ep0 handler if it is.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">uint32_t usbCommonInterruptMask = SI32_USB_A_read_cmint(SI32_USB_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">uint32_t usbEpInterruptMask = SI32_USB_A_read_ioint(SI32_USB_0);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_USB_A_write_cmint(SI32_USB_0, usbCommonInterruptMask);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">SI32_USB_A_write_ioint(SI32_USB_0, usbEpInterruptMask);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">if (usbEpInterruptMask & SI32_USB_A_IOINT_EP0I_MASK)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB0_ep0_handler();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">return;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">EP0 Setup Data handle.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 10pt;">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">First, we need read 8 bytes from EP0 fifo</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">for (uint8_t RequestHeaderByte = 0; RequestHeaderByte < sizeof(USB_Request_Header_t); RequestHeaderByte++)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>*(RequestHeader++) = Endpoint_Read_8();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 10pt;">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Second, we handler difference request type. The form look likes below</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">switch (USB_ControlRequest.bRequest)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">case REQ_GetStatus:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB_Device_GetStatus();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">case REQ_ClearFeature:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">case REQ_SetFeature:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB_Device_ClearSetFeature();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">case REQ_SetAddress:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB_Device_SetAddress();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">case REQ_GetDescriptor:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB_Device_GetDescriptor();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">case REQ_GetConfiguration:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB_Device_GetConfiguration();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">case REQ_SetConfiguration:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB_Device_SetConfiguration();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">4.3 USB Class special request handler.</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">For CDC class special command handle, we have four commands as we talked before. Here are sample code for reference.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">switch (USB_ControlRequest.bRequest)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">case CDC_REQ_GetLineEncoding:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Endpoint_Write_32_LE(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.CharFormat);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.ParityType);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.DataBits);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">case CDC_REQ_SetLineEncoding:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">CDCInterfaceInfo->State.LineEncoding.BaudRateBPS = Endpoint_Read_32_LE();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">CDCInterfaceInfo->State.LineEncoding.CharFormat <span class="Apple-converted-space"> </span>= Endpoint_Read_8();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">CDCInterfaceInfo->State.LineEncoding.ParityType <span class="Apple-converted-space"> </span>= Endpoint_Read_8();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">CDCInterfaceInfo->State.LineEncoding.DataBits <span class="Apple-converted-space"> </span>= Endpoint_Read_8();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">case CDC_REQ_SetControlLineState:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">CDC_Device_SendControlLineStateChange(CDCInterfaceInfo);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">case CDC_REQ_SendBreak:</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">4.4 Realize virtual COM port function.</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">For virtual COM port function, we need to received data from USB OUT and send it to UART TX, or receive data from UART RX and send out through USB IN request. <span class="Apple-converted-space"> </span>We need define two ring buffer to store data for USB2UART and UART2USB.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">RingBuffer_InitBuffer(&USBtoUSART_Buffer, USBtoUSART_Buffer_Data, sizeof(USBtoUSART_Buffer_Data));</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">RingBuffer_InitBuffer(&USARTtoUSB_Buffer, USARTtoUSB_Buffer_Data, sizeof(USARTtoUSB_Buffer_Data));</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 10pt;">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">UART receive data interrupt</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">void uart_rev_handler(void)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">uint8_t ReceivedByte = uart_get_byte();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">if (USB_DeviceState == DEVICE_STATE_Configured)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">RingBuffer_Insert(&USARTtoUSB_Buffer, ReceivedByte);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 10pt;">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">USB receive data interrupt</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">void EVENT_USB_recv_data(void)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">if (!(RingBuffer_IsFull(&USBtoUSART_Buffer)))</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">int16_t ReceivedByte = CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">if (!(ReceivedByte < 0))</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span>RingBuffer_Insert(&USBtoUSART_Buffer, ReceivedByte);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: 'Courier New'; font-size: 10pt;">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Foreground logical control</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">while(1)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">uint16_t BufferCount = RingBuffer_GetCount(&USARTtoUSB_Buffer);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">if(BufferCount > 0)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">while (BufferCount--)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 112.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">if (CDC_Device_SendByte(&VirtualSerial_CDC_Interface,</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 274.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">RingBuffer_Peek(&USARTtoUSB_Buffer)) != ENDPOINT_READYWAIT_NoError)</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 112.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 139.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">break;</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 112.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 112.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">RingBuffer_Remove(&USARTtoUSB_Buffer);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Endpoint_ClearIN();</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 58.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">if (!(RingBuffer_IsEmpty(&USBtoUSART_Buffer)))</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 85.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">uart_send_byte(RingBuffer_Remove(&USBtoUSART_Buffer));</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;">4.5 Prepare INF file for CDC device.</span></b><span style="color: #366092; font-family: Calibri, sans-serif; font-size: 13pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
</div>
<img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkMAAAdWCAIAAACGeDtDAAAgAElEQVR4nOzdPZLiMBCGYZ2JDG5CTnEMbkAVN+AOBMScgmSCuccku4Gx1ZK6ZfkHsOCdeoJdBsuyYfwh26jdv79fAADq5d7eAwAApiDJAAB1I8kAAHUjyQAAdSPJbJetWx9+5m/5dlo751za+HXn3O78/g1f7q77GLfT2u0vAxb5nPcG8AS9SZb8ycmD1GXr2p/2Oe1h+vGzvarN3g+b7imP1qIFk79zZZEnSw7H8mhy3Tnn3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rm5JG2hZke6x2m33Y+VyY7j5R51w6SCVqIG41MRjzIfSs+wh0ZXK3HFM9brF3EZzSbGTlpWzpQAu8wcwTPkcnC7FQzPg+XMu/aQTJBC/HNkDOazZOhxQ7hIxEduNcw39vhLN5ggfVsZuSkbflACWMOzcLTZzLed4+VMu/cQTJBC3H5vD57jQ/xTMh6pfgLgVEmE5MgHfODUSYT50WZTAjRgzKZOC/KZEIIIebmP2wzQ55jytlsAAAAAElFTkSuQmCC" /><div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="color: #17365d; font-family: Symbol; font-size: 10pt;"><span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">5.</span></b> <span class="Apple-converted-space"> </span></span></span><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">Validate USB CDC function.</span></b></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">We are talking about Win7 installation. Build project and download firmware into SiM3U1xx MCU card, plug in USB cable, it will show "SiM3U1xx CDC Class" under "Other devices" <span class="Apple-converted-space"> </span>in Device Manger,</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGv5HQgEXTMSh-FZf3oFcnqJ7r7U4kAlwFcXh5yX2UUnEYNDNMhh8q888-ZKeCTbQQ9ZpgHRXF0uxVLgV_G18ZP4GOaATYtXFbou_JgxH0fzAjqJHPxQBAXxw_doHr_sdo-0WwrEVvhaJj/s1600/image019.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGv5HQgEXTMSh-FZf3oFcnqJ7r7U4kAlwFcXh5yX2UUnEYNDNMhh8q888-ZKeCTbQQ9ZpgHRXF0uxVLgV_G18ZP4GOaATYtXFbou_JgxH0fzAjqJHPxQBAXxw_doHr_sdo-0WwrEVvhaJj/s1600/image019.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Right click and choose "Update Driver Software"</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFJi9cKEOpdoWKqkociMrwC2D6_HTvMaMZ1DgkGRQcDoeFa2l84q_hqxBMxK9tUHdBA-8QphHkx-xGze-Hy_hQ1D5ghlBbLMBLli-_wRU_hV59kZ9wb_yzWwsquTiSUgxNM65mRW4VcPd8/s1600/image021.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFJi9cKEOpdoWKqkociMrwC2D6_HTvMaMZ1DgkGRQcDoeFa2l84q_hqxBMxK9tUHdBA-8QphHkx-xGze-Hy_hQ1D5ghlBbLMBLli-_wRU_hV59kZ9wb_yzWwsquTiSUgxNM65mRW4VcPd8/s1600/image021.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">select "Browse my computer for driver software", enter directory path of your CDC_ACM.inf</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSjjX6Is2T40KyOJuQrMWSl3deUJPspb563brf2qiUp7WkBUAY11zfn76HwjNvTeqYkj6Lpj259beFz5JNlT4el8YEa-nBstTkYL3wZfVcPCCv0nt1QFVZjMatDt80f2xSkblLRoex7unu/s1600/image023.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSjjX6Is2T40KyOJuQrMWSl3deUJPspb563brf2qiUp7WkBUAY11zfn76HwjNvTeqYkj6Lpj259beFz5JNlT4el8YEa-nBstTkYL3wZfVcPCCv0nt1QFVZjMatDt80f2xSkblLRoex7unu/s1600/image023.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Windows will show below message, just choose install this driver software anyway.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjow-7K2n9-HwgDNgaPSq4yRDAEel5ZGiQL4jZrWvTK_h1Cq9lODkbSUy0S56j3ZKh1GyMWb8WcaZ-xY6NIXrCrRXLSlkfbJQYUCKbLf6bwZciuDuOblAbwOYwyels8JODOHbAm1s3rJPpC/s1600/image025.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjow-7K2n9-HwgDNgaPSq4yRDAEel5ZGiQL4jZrWvTK_h1Cq9lODkbSUy0S56j3ZKh1GyMWb8WcaZ-xY6NIXrCrRXLSlkfbJQYUCKbLf6bwZciuDuOblAbwOYwyels8JODOHbAm1s3rJPpC/s1600/image025.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">After done, it shows below message.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbWPWxebJyJpYaexCErWrxIWMa-TNNBwhuzw2PjraSDbV-Cjpr8E-WZa85DgS3E88cWwd4AS6hjQcUShODGfMZf97YSrpAWtasMlzs3hj5xYp7K7rC3vdwKO7bKllwA2qQuaN00PGWjVOs/s1600/image027.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbWPWxebJyJpYaexCErWrxIWMa-TNNBwhuzw2PjraSDbV-Cjpr8E-WZa85DgS3E88cWwd4AS6hjQcUShODGfMZf97YSrpAWtasMlzs3hj5xYp7K7rC3vdwKO7bKllwA2qQuaN00PGWjVOs/s1600/image027.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Check in Device Manager, you can find new COM port appear in Ports(COM &LPT). And now you can access this COM port with any serial tool.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFJi9cKEOpdoWKqkociMrwC2D6_HTvMaMZ1DgkGRQcDoeFa2l84q_hqxBMxK9tUHdBA-8QphHkx-xGze-Hy_hQ1D5ghlBbLMBLli-_wRU_hV59kZ9wb_yzWwsquTiSUgxNM65mRW4VcPd8/s1600/image021.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKwlFxT8yxBTeX1Cyc_QlW60u0mQI2yJ-SgAcgHXUZkcTdShW5qlyCE3Bh55tE97AvN6l_H7Epfg0cLCSSB-F5_EMuTc9PtPHZazYQKzXGrO4x6zPBMYfTSxnU5qj0f6BIR26xaJc3DcNN/s1600/image029.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKwlFxT8yxBTeX1Cyc_QlW60u0mQI2yJ-SgAcgHXUZkcTdShW5qlyCE3Bh55tE97AvN6l_H7Epfg0cLCSSB-F5_EMuTc9PtPHZazYQKzXGrO4x6zPBMYfTSxnU5qj0f6BIR26xaJc3DcNN/s1600/image029.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> That is to say, We have done with USB CDC driver development. It is quite easy, isn't?</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">6.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span></b><b><span style="color: #17365d; font-family: Calibri, sans-serif; font-size: 16pt;">Source code</span></b></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">We don’t' want to reinvent the wheel, so this USB CDC base on open source project LUFA, in terms of MIT License.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 31.4pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Source code can be found in<span class="Apple-converted-space"> </span></span><a href="https://github.com/MarkDing/USB_CDC" style="color: purple; text-decoration: underline;"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">https://github.com/MarkDing/USB_CDC</span></a><span style="font-family: Calibri, sans-serif; font-size: 11pt;">.</span></div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com6tag:blogger.com,1999:blog-6138180379582869534.post-73413932773930368472012-12-03T18:25:00.000-08:002012-12-04T20:17:12.016-08:00USB CDC command verifier test<br />
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">1.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Run USB 2.0 Command Verifier</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">It display below message, we need choose second host controller.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLsB1G5_bcU81TFC612Zwto2fl3VjQjzgu7izULTR5Hm1uH5eK5yT_QLnHr-WWmHT6vLyVWBUOxTokoKZ2FAUcsSsCY-fOIrI6a5rn603G7OtJF9zjnzP5wjyAWpWEwmd1oKQQTKnxhxOj/s1600/image001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLsB1G5_bcU81TFC612Zwto2fl3VjQjzgu7izULTR5Hm1uH5eK5yT_QLnHr-WWmHT6vLyVWBUOxTokoKZ2FAUcsSsCY-fOIrI6a5rn603G7OtJF9zjnzP5wjyAWpWEwmd1oKQQTKnxhxOj/s1600/image001.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">But when we select it<span class="GramE">, <span class="Apple-converted-space"> </span>USB</span><span class="Apple-converted-space"> </span>mouse and keyboard lose control, we need find PS2 mouse and then we can continue testing.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">It opens window like below, we click on Run button, but get error.</span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMz4SiJdXlJlSsPx1L54OY4bMF0VrV2tvFeYIg3HSYa6JK1CIgu5fu0C7MEFMin1aQfWEOUBuWDyoFKauXGRqAvppsLmHq98Jgd-j6Fe81MwXaZLSAAh4ZDoh1VljT38JsJI6RRc0nF8Kc/s1600/image003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMz4SiJdXlJlSsPx1L54OY4bMF0VrV2tvFeYIg3HSYa6JK1CIgu5fu0C7MEFMin1aQfWEOUBuWDyoFKauXGRqAvppsLmHq98Jgd-j6Fe81MwXaZLSAAh4ZDoh1VljT38JsJI6RRc0nF8Kc/s1600/image003.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="color: #595959; font-family: Calibri, sans-serif; font-size: 9pt;">Screen clipping taken: 12/3/2012 4:56 PM</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> The reason is<span class="Apple-converted-space"> </span><span class="GramE">We</span><span class="Apple-converted-space"> </span>have a Card reader socket in LCD monitor, so that is a mass storage device which is not allowed by USB CV. <span class="Apple-converted-space"> </span>Disable USB Mass Storage Device in Device Manager.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5jvp8T5bKCnAXMhDwjTQM9hZh02lDE51tKNTIxgEXaHswRVPjuo8FajqMFlK2gBk3nwSsDezgLUAzKMK-SJtWr8Jrm54E-l7r2j7SW5bpKeMQWPwOJPBRGuDiqKzx1O5ybZ0qUkI9DMZq/s1600/image005.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5jvp8T5bKCnAXMhDwjTQM9hZh02lDE51tKNTIxgEXaHswRVPjuo8FajqMFlK2gBk3nwSsDezgLUAzKMK-SJtWr8Jrm54E-l7r2j7SW5bpKeMQWPwOJPBRGuDiqKzx1O5ybZ0qUkI9DMZq/s1600/image005.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">And then we run it again, and select our device VID=10c4, PID=A002</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB1H2PGdZ4edHKfFT-beMaErcWWbSOLPw-YM8bU0vs3ZyRhq5H7EBZicp8YJtx7QJv6LJc1vvJRHg7HjLVaUf35KdljejAUmo0iAApm2Vdoy8m-1gU99Xat_8DRv8L4fqvO2dpTdHy9trD/s1600/image007.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB1H2PGdZ4edHKfFT-beMaErcWWbSOLPw-YM8bU0vs3ZyRhq5H7EBZicp8YJtx7QJv6LJc1vvJRHg7HjLVaUf35KdljejAUmo0iAApm2Vdoy8m-1gU99Xat_8DRv8L4fqvO2dpTdHy9trD/s1600/image007.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="color: #595959; font-family: Calibri, sans-serif; font-size: 9pt;">Screen clipping taken: 12/3/2012 4:57 PM</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Here is the<span class="Apple-converted-space"> </span><span class="GramE">result,</span><span class="Apple-converted-space"> </span>we passed most of tests, but failure with item "Halt Endpoint Test".</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTHdoxWQX7LI8CeQL-d0wZ7K6vogW79F6YB6rkLmBNom_07q6pHixVd-PofLcdd7TK9tbHaRUzCktdPpR2jLYs-a4e6Bg6jNC_azarR4h5vUi39V3Oakfy8WjfN-z98AbK6Q7E5xZ0OfFz/s1600/image009.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTHdoxWQX7LI8CeQL-d0wZ7K6vogW79F6YB6rkLmBNom_07q6pHixVd-PofLcdd7TK9tbHaRUzCktdPpR2jLYs-a4e6Bg6jNC_azarR4h5vUi39V3Oakfy8WjfN-z98AbK6Q7E5xZ0OfFz/s1600/image009.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="color: #595959; font-family: Calibri, sans-serif; font-size: 9pt;">Screen clipping taken: 12/3/2012 5:00 PM</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Description of Halt Endpoint Test failed.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Halt Endpoint<span class="Apple-converted-space"> </span><span class="GramE">Test <span class="Apple-converted-space"> </span>Failed</span></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Start</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>time: Mon Dec 03 16:58:38 2012</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Testing</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>Interface number : 0 Alternate setting : 0</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">WARNING <span class="Apple-converted-space"> </span><span class="SpellE">SetInterface</span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>with interface number : 0 failed.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Testing</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span><span class="SpellE">EndPoint</span><span class="Apple-converted-space"> </span>type : Interrupt, Address : 81</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Endpoint</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>is currently not halted</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">ERROR <span class="Apple-converted-space"> </span>Endpoint</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>could not be halted</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO Cleared endpoint halt</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<b><span style="color: red; font-family: Calibri, sans-serif; font-size: 11pt;">FAIL (1.2.91)<span class="Apple-converted-space"> </span><span class="GramE">A</span><span class="Apple-converted-space"> </span>device that has Bulk/Interrupt endpoints must support the Halt Endpoint request on those endpoints.</span></b><span style="color: red; font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Testing</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>Interface number : 1 Alternate setting : 0</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">WARNING <span class="Apple-converted-space"> </span><span class="SpellE">SetInterface</span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>with interface number : 1 failed.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Testing</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span><span class="SpellE">EndPoint</span><span class="Apple-converted-space"> </span>type : Bulk, Address : 3</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Endpoint</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>is currently not halted</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">ERROR <span class="Apple-converted-space"> </span>Endpoint</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>could not be halted</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Cleared</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>endpoint halt</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">FAIL <span class="Apple-converted-space"> </span>(</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">1.2.91) A device that has Bulk/Interrupt endpoints must support the Halt Endpoint request on those endpoints.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Testing</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span><span class="SpellE">EndPoint</span><span class="Apple-converted-space"> </span>type : Bulk, Address : 82</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Endpoint is currently not halted</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">ERROR <span class="Apple-converted-space"> </span>Endpoint</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>could not be halted</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Cleared</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>endpoint halt</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">FAIL <span class="Apple-converted-space"> </span>(</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">1.2.91) A device that has Bulk/Interrupt endpoints must support the Halt Endpoint request on those endpoints.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Stop</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>time: Mon Dec 03 16:58:55 2012</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Duration</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">: 17 seconds.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><span style="font-family: Calibri, sans-serif; font-size: 11pt;">INFO <span class="Apple-converted-space"> </span>Stopping</span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>Test [ Halt Endpoint Test (Configuration Index 0): Number of: Fails (3); Aborts (0); Warnings (2) ]</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">2.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Analysis.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Capture USB data during "Halt Endpoint Test" from<span class="Apple-converted-space"> </span><span class="SpellE">Ellisys</span><span class="Apple-converted-space"> </span>USB protocol explorer. We know USB CV execute two<span class="Apple-converted-space"> </span><span class="GramE">command</span>. Since the protocol analyzer communicate with PC through USB interface, and CV run, the USB driver was replaced, USB protocol software won't work. We have to setup USB protocol analyzer software in another PC.</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">First it execute<span class="Apple-converted-space"> </span><span class="SpellE"><span class="GramE">SetFeature</span></span><span class="GramE">(</span>) to halt endpoint <span class="Apple-converted-space"> </span>and then<span class="Apple-converted-space"> </span><span class="SpellE">GetStatus</span><span class="Apple-converted-space"> </span>to learn whether endpoint halt. From the log, I can see that<span class="Apple-converted-space"> </span><span class="SpellE">GetStatus</span>reports that Endpoint doesn't<span class="Apple-converted-space"> </span><span class="GramE">halted</span>.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_JjklP7mmoCRPRHC-2hba32xgkVKVhurBrdYpkvf6vil3dmPa-iHRaDcRZR27wRWLC7odEsTZsh9cD9UXBD3qhjGeaUcIoXtDx_4crMoTRG5oUuVtG-o0nYqQZtULcNACGf4xeAVf3QMS/s1600/image011.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_JjklP7mmoCRPRHC-2hba32xgkVKVhurBrdYpkvf6vil3dmPa-iHRaDcRZR27wRWLC7odEsTZsh9cD9UXBD3qhjGeaUcIoXtDx_4crMoTRG5oUuVtG-o0nYqQZtULcNACGf4xeAVf3QMS/s1600/image011.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
</div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="color: #595959; font-family: Calibri, sans-serif; font-size: 9pt;">Screen clipping taken: 12/3/2012 7:25 PM</span></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">3.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Check code.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">In<span class="Apple-converted-space"> </span><span class="SpellE"><span class="GramE">GetStatus</span></span><span class="GramE">(</span>) function we see below code.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> <span class="Apple-converted-space"> </span><span class="SpellE">CurrentStatus</span><span class="Apple-converted-space"> </span>=<span class="Apple-converted-space"> </span><span class="SpellE">Endpoint_<span class="GramE">IsStalled</span></span><span class="GramE">(</span>);</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Check<span class="Apple-converted-space"> </span><span class="SpellE"><i>Endpoint_<span class="GramE">IsStalled</span></i></span><span class="GramE"><i>(</i></span><i>),</i></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">if(</span></i></span><span class="SpellE"><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Endpoint_GetEndpointDirection</span></i></span><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">()== ENDPOINT_DIR_IN)</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 81pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">status</span></i></span><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>=<span class="Apple-converted-space"> </span><span class="SpellE">USB_EPn</span>(<span class="SpellE">usb_ep_selected</span>)->EPCONTROL.ISTSTLI;</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">else</span></i></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 81pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">status</span></i></span><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>=<span class="Apple-converted-space"> </span><span class="SpellE">USB_EPn</span>(<span class="SpellE">usb_ep_selected</span>)->EPCONTROL.OSTSTLI;</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">We should not judge endpoint stall status by<span class="Apple-converted-space"> </span><span class="GramE">those</span><span class="Apple-converted-space"> </span>two bit, but instead of below code.</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">if(</span></i></span><span class="SpellE"><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Endpoint_GetEndpointDirection</span></i></span><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">()== ENDPOINT_DIR_IN)</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 81pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">status</span></i></span><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>=<span class="Apple-converted-space"> </span><span class="SpellE">USB_EPn</span>(<span class="SpellE">usb_ep_selected</span>)->EPCONTROL.ISDSTL;</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">else</span></i></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">{</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 81pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span class="GramE"><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">status</span></i></span><i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"><span class="Apple-converted-space"> </span>=<span class="Apple-converted-space"> </span><span class="SpellE">USB_EPn</span>(<span class="SpellE">usb_ep_selected</span>)->EPCONTROL.OSDSTL;</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<i><span style="font-family: Calibri, sans-serif; font-size: 11pt;">}</span></i><span style="font-family: Calibri, sans-serif; font-size: 11pt;"></span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
<div class="MsoNormal" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: -0.25in; text-transform: none; vertical-align: middle; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">4.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> <span class="Apple-converted-space"> </span></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt;">Verify</span></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt 27pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Run USB CV again, we pass the "Halt Endpoint Test"</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3hyphenhyphenuvY7GfL53r_7Uh7O06HDRtO6Dp-gycRqdw44yrkPRsBn-8ALLqKsCepMAgH6Mh8nYPi1i13Lshbdlf_TPdTEX7cEgEuueklphH4ap_b8e6QSEt5r5A_FwZEbTcl1rHlDndxR4FHrjD/s1600/image013.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3hyphenhyphenuvY7GfL53r_7Uh7O06HDRtO6Dp-gycRqdw44yrkPRsBn-8ALLqKsCepMAgH6Mh8nYPi1i13Lshbdlf_TPdTEX7cEgEuueklphH4ap_b8e6QSEt5r5A_FwZEbTcl1rHlDndxR4FHrjD/s1600/image013.png" /></a></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman', serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0in 0in 0.0001pt; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /></div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-66066093980190906502012-11-09T23:07:00.004-08:002012-11-11T18:03:43.828-08:00Porting FreeRTOS to SiM3U167 Cortex M3<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>ZH-CN</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
<w:UseFELayout/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
<br />
<div align="center" class="MsoNormal" style="text-align: center;">
<b style="mso-bidi-font-weight: normal;"><span style="font-size: 18.0pt; line-height: 115%;">Porting FreeRTOS to
SiM3U167 Cortex M3</span></b></div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>RTOS is just an
application which can execute difference function base on different trigger
conditions, something like system ticket, interrupt, and message queue.etc. And
also need protect some share resource would be accessed by difference function,
or we call it task at one time. </div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>For Arm Cortex
M3, there two popular RTOS, one it uC/OSII, the other one is FreeRtos. We
pickup FreeRTOS as our target since it free and open source.<span style="mso-spacerun: yes;"> </span>The poring procedure is pretty easy, let
start it. </div>
<h3 class="MsoListParagraphCxSpFirst" style="mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Get Latest FreeRtos 7.3.0 source code.</h3>
<div class="MsoListParagraphCxSpMiddle">
Go to <a href="http://www.freertos.org/">http://www.freertos.org/</a>,
and download it to your PC, extract it. We can see directory structure like
below.</div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\FreeRTOS</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\FreeRTOS-Plus</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\readme.txt</span></div>
<div class="MsoListParagraphCxSpMiddle">
Just go through the directory, there are a
lot of difference platform support codes. We need Cortex M3 and GCC. So here
are the resources we need.</div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\FreeRTOS\Source\*.*</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\FreeRTOS\Source\include\*.*</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\FreeRTOS\Source\portable\GCC\ARM\CM3\*.*</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\FreeRTOS\Source\portable\MemMang\heap_4.c</span></div>
<div class="MsoListParagraphCxSpMiddle">
And one head file needed, FreeRTOSConfig.h</div>
<div class="MsoListParagraphCxSpMiddle">
I just choose \FreeRTOS\Demo\CORTEX_LM3S811_GCC\
FreeRTOSConfig.h, and copy it into \FreeRTOS\Source\include\</div>
<h3 class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Prepare our RTOS directory.</h3>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo2; text-indent: -.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">a)<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Created a directory “FreeRTOSV7.3.0”.</div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo2; text-indent: -.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">b)<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Copy a Blinky example code as code base and copy
startup file in it.Exclude original startup file from project.</div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo2; text-indent: -.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">c)<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Copy FreeRTOS directory into this directory. </div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo2; text-indent: -.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">d)<span style="font: 7.0pt "Times New Roman";">
</span></span></span>The directory structure now looks like this</div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\FreeRTOS\Source\*.*</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\FreeRTOS\Source\include\*.*</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\FreeRTOS\Source\portable\GCC\ARM\CM3\*.*</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\FreeRTOS\Source\portable\MemMang\heap_4.c</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\src\*.*</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">\src\generated\*.*</span></div>
<h3 class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Precistion32 environment setting and interrupt
handler functions modification.</h3>
<div class="MsoListParagraphCxSpMiddle">
Include paths looks like this:</div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">"${workspace_loc:/sim3u1xx_FreeRtos/src}"</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">"${workspace_loc:/sim3u1xx_FreeRtos/src/generated}"</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">"${workspace_loc:/sim3u1xx_FreeRtos/FreeRTOS/Source/include}"</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">"${workspace_loc:/sim3u1xx_FreeRtos/FreeRTOS/Source/portable/GCC/ARM_CM3}"</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">"${SI32_PATH}/si32Hal/sim3u1xx"</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">"${SI32_PATH}/si32Hal/SI32_Modules"</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">"${SI32_PATH}/si32Hal/CPU"</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">Open start up file src\startup_sim3u1xx_p32.c, changed three handler
functions. In vector table “void (* const g_pfnVectors[])(void)”,</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: .75in; mso-add-space: auto; mso-list: l2 level1 lfo3; text-indent: -.25in;">
<span style="font-size: 9.0pt; line-height: 115%; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">a)<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-size: 9.0pt; line-height: 115%;">Change
SVCall handler to “vPortSVCHandler”</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: .75in; mso-add-space: auto; mso-list: l2 level1 lfo3; text-indent: -.25in;">
<span style="font-size: 9.0pt; line-height: 115%; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">b)<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-size: 9.0pt; line-height: 115%;">Change
PendSV handler to “xPortPendSVHandler”</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: .75in; mso-add-space: auto; mso-list: l2 level1 lfo3; text-indent: -.25in;">
<span style="font-size: 9.0pt; line-height: 115%; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">c)<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-size: 9.0pt; line-height: 115%;">Change
SysTick handler to “xPortSysTickHandler”</span></div>
<h3 class="MsoListParagraphCxSpLast" style="mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 9.0pt; line-height: 115%; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Added task test code in main.c<span style="font-size: 9.0pt; line-height: 115%;"></span></h3>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"> <b>task1</b>(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"> * parameters)</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">{</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span></span><span style="color: #005032; font-family: "Courier New"; font-size: 8.0pt;">uint32_t</span><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"> count = 0;</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">const</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"> portCHAR
*pcPassMessage = </span><span style="color: #2a00ff; font-family: "Courier New"; font-size: 8.0pt;">"PASS"</span><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">;</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">while</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">(1)</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span>{</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 2;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">(SI32_PBSTD_A_read_pin(SI32_PBSTD_2,
8)==0)</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 2;"> </span>{</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 3;"> </span></span><b><span style="color: #642880; font-family: "Courier New"; font-size: 8.0pt;">printf</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">(</span><span style="color: #2a00ff; font-family: "Courier New"; font-size: 8.0pt;">"Task1
running %d\n"</span><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">,count++);</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 3;"> </span>xQueueSend(
xLEDQueue, &pcPassMessage, portMAX_DELAY );</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 2;"> </span>}</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span>}</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">}</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"> <b>task2</b>(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"> * parameters)</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">{</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span></span><span style="color: #005032; font-family: "Courier New"; font-size: 8.0pt;">uint32_t</span><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"> count = 0;</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">while</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">(1)</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span>{</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 2;"> </span></span><b><span style="color: #642880; font-family: "Courier New"; font-size: 8.0pt;">printf</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">(</span><span style="color: #2a00ff; font-family: "Courier New"; font-size: 8.0pt;">"Task2
running %d\n"</span><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">,count++);</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 2;"> </span>vTaskDelay(
1000 );</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span>}</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">}</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"> <b>task3</b>(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"> * parameters)</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">{</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span></span><span style="color: #005032; font-family: "Courier New"; font-size: 8.0pt;">uint32_t</span><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"> count = 0;</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span>portCHAR *pcMessage;</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">while</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">(1)</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span>{</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 2;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 8.0pt;">/* Wait for a
message to arrive. */</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 2;"> </span>xQueueReceive(
xLEDQueue, &pcMessage, portMAX_DELAY );</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 2;"> </span>SI32_PBSTD_A_toggle_pins(SI32_PBSTD_2,0xc00);</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 2;"> </span></span><b><span style="color: #642880; font-family: "Courier New"; font-size: 8.0pt;">printf</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">(</span><span style="color: #2a00ff; font-family: "Courier New"; font-size: 8.0pt;">"Task3
running %d<span style="mso-spacerun: yes;"> </span>%s\n"</span><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">,count++,pcMessage);</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span>}</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">}</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"> <b>main</b>()</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">{</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">while</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">(SI32_PBSTD_A_read_pin(SI32_PBSTD_2,
8) == 0);</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 8.0pt;">// Enter the
default operating mode for this application (gModes.c)</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-spacerun: yes;">
</span>gModes_enter_my_default_mode();</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 8.0pt;">// Print a
starting message</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #642880; font-family: "Courier New"; font-size: 8.0pt;">printf</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">(</span><span style="color: #2a00ff; font-family: "Courier New"; font-size: 8.0pt;">"hello
world\n"</span><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">);</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 8.0pt;">/* Create the
queue used to pass message to vPrintTask. */</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-spacerun: yes;"> </span>xLEDQueue = xQueueCreate(
3, </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">sizeof</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">( portCHAR * ) );</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-spacerun: yes;"> </span><u>xTaskCreate( task1, </u></span><u><span style="color: #2a00ff; font-family: "Courier New"; font-size: 8.0pt;">"task1"</span></u><u><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">, 200, NULL, 1,
NULL );</span></u><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-spacerun: yes;"> </span><u>xTaskCreate( task2, </u></span><u><span style="color: #2a00ff; font-family: "Courier New"; font-size: 8.0pt;">"task2"</span></u><u><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">, 200, NULL, 2,
NULL );</span></u><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-spacerun: yes;"> </span><u>xTaskCreate( task3, </u></span><u><span style="color: #2a00ff; font-family: "Courier New"; font-size: 8.0pt;">"task3"</span></u><u><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">, 200, NULL, 2,
NULL );</span></u><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-tab-count: 1;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 8.0pt;">/* Start the
scheduler running the tasks and <u>co</u>-routines just created. */</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-spacerun: yes;"> </span>vTaskStartScheduler();</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 8.0pt;">while</span></b><span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">(1);</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 8.0pt;">// Loop
forever...</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: black; font-family: "Courier New"; font-size: 8.0pt;">}</span><span style="font-family: "Courier New"; font-size: 8.0pt;"></span></div>
<h3 class="MsoListParagraphCxSpFirst" style="mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">5.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Run the code,</h3>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">We can task output from serial view window.</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">hello world</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">Task2 running 0</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">Task2 running 1</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">If we press SW2(PB2.8), we can see task1 and task3 active and output
message</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">Task1 running 0</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">Task3 running 0<span style="mso-spacerun: yes;"> </span>PASS</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">Task1 running 1</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-size: 9.0pt; line-height: 115%;">Task3 running 1<span style="mso-spacerun: yes;"> </span>PASS</span></div>
<h3 class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">6.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Source code</h3>
<div class="MsoListParagraphCxSpMiddle">
We can get source code from https://github.com/MarkDing/sim3u1xx_FreeRtos</div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: .75in; mso-add-space: auto;">
<br /></div>
<div class="MsoListParagraphCxSpLast">
<br /></div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-42904878448832836082012-10-25T21:42:00.003-07:002012-10-25T21:42:35.492-07:00USB debug adapter SWD connect with Arm Cortex M3 failure analysis There is an issue reported from customer that Silabs USB debug adapter (UDA) cannot<br />connect with SiM3U1xx MCU card board. When they try to download code into MCU under<br />preceistion32 IDE, it got below message.<br /><br />“Error message: 02: Failed on connect: Em(04). Cannot provide power to DAP bus. Emu(0):<br />Conn&Reset. Was: None. DpID: 2BA01477. Info: UDA000C5EFB”<br /><br />Once new chip been programmed and UDA cannot connect with MCU any more.<br /><br />What could cause the connection failure? Normally, set system clock incorrectly or put MCU<br />into low power mode will cause such issue. So I suggest customer to use si32FlashUtility to erase<br />internal flash. "si32FlashUtility.exe -r 1 -e 2". In startup code, there is 500ms delay which allows<br />UDA take control of MCU, and then si32FlashUtility.exe can erase the wrong firmware inside<br />flash. But things not go smooth. Customer replied that it doesn’t work and error message out:<br />“ADI_STTUS_API_NOT_CONNECTED_TO_TARGET”. There is weird thing and asked customer<br />sends their board and source code to me.<br /><br />
<h2>
<b>Investigating:</b></h2>
<br />
<h3>
<b>Customer’s code Analysis:</b></h3>
<br />I start testing on my board with customer’s code at first. I added back door code to prevent<br />unexpected situation. Add check GPIO status at beginning of main function.<br /><br />#include <si32_clkctrl_a_type .h=".h"><br />void check_gpio()<br />{<br />SI32_CLKCTRL_A_enable_apb_to_modules_0(SI32_CLKCTRL_0,SI32_CLKCTRL_A_APBCLKG0_P<br />B0);<br />while(SI32_PBSTD_A_read_pin(SI32_PBSTD_2,8) == 0);<br />SI32_PBSTD_A_set_pins_push_pull_output(SI32_PBSTD_2, 0x00000C00);<br />SI32_PBSTD_A_write_pins_low(SI32_PBSTD_2, 0x00000C00);<br />SI32_PBCFG_A_enable_crossbar_1(SI32_PBCFG_0);<br />}<br /><br />And we also have 500ms delay in Systeminit function by default.<br /><br />void SystemInit(void)<br />{<br />// To disable the pin reset delay described below, make sure the preprocessor<br />// symbol si32HalOption_disable_pin_reset_delay is defined by your toolchain.<br /># if !defined(si32HalOption_disable_pin_reset_delay)<br />// If the reset pin was the source of the last reset, delay for 500 msec.<br />// Firmware can disable the debug port by inadvertantly setting the AHB<br />// clock source to a disabled clock. If this happens too quickly after a<br />// reset, it is not possible for a debug agent to gain control and thus<br />// not possible to reprogram the on-chip flash. Adding a delay here gives<br />// a debug agent sufficient time to connect.<br />if ((SI32_RSTSRC_0->RESETFLAG.PINRF == 1)<br />&& (SI32_RSTSRC_0->RESETFLAG.PORRF == 0)<br />&& (SI32_RSTSRC_0->RESETFLAG.VMONRF == 0))<br /><br />SysTick->VAL = 0;<br />SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk;<br /><br />// Wait for the count down to complete<br />while (0 == (SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk)) {}<br /><br />// Set the SysTick timer to reset values<br />SysTick->CTRL = 0;<br />SysTick->LOAD = 0;<br />SysTick->VAL = 0;<br /><br />}<br /># endif<br /><br />// invoke the application's system initialization.<br />mySystemInit();<br /><br />}<br /><br />Run the code and I can see connect failure happened, same as customer’s issue. I ran<br />"si32FlashUtility.exe -r 1 -e 2", it can erase firmware from internal flash. I just check customer’s<br />code. I found the reason cause connection failure. They try to make system clock configuration<br />change to external CMOS. But the setting of the XTAL2 pin is wrong. It set it as analog mode<br />instead of digital input. So when switch system clock to external CMOS, the MCU hang. And also<br />ETM enabled by customer. It is not necessary. I just comment out the system clock modification<br />part. And UDA can connect with MCU card board.<br /></si32_clkctrl_a_type><br />
<h3>
<b><span style="font-weight: normal;">Customer’s board analysis:</span></b></h3>
<br />But customer’s board cannot be recovered by "si32FlashUtility.exe -r 1 -e 2", what happens<br />with customer’s board? First, I need to confirm whether customer’s code contains 500ms delay.<br />This is default routine in SDK. And since customer’s code set ETM enable, this setting will draw<br />down ETM pin, those pins are high when I press RESET pin. So I can compare RESET and ETM<br />pin to know whether 500ms delay was executed. And the result shows no 500ms delay at all.<br />That is why si32FlashUtility cannot erase firmware. I have measure timing of the code execution.<br />It only takes dozens micro seconds to run from power on to system clock modification part.<br />I checked si32FlashUtility, it issue reset action on RESET pin, and 4ms later, and it start to<br />communicate with MCU, the communication period about 50mS. So that insufficient to take<br />control from MCU.<br /><br />
<h2>
Solution:</h2>
<br />Make sure add back door code in project. Include long delay and GPIO checking.Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com2tag:blogger.com,1999:blog-6138180379582869534.post-26700357756915009862012-10-19T01:29:00.000-07:002012-11-06T17:20:20.938-08:00With openpyxl for python3 to access excel 2007<br />
<div class="WordSection1">
<h1>
Goal:</h1>
<div class="MsoNormal">
<span style="font-size: 10.0pt; line-height: 115%;"><span style="mso-spacerun: yes;"> </span></span><span style="font-size: 10.0pt; line-height: 115%; mso-fareast-language: EN-US;"><span style="mso-spacerun: yes;"> </span></span>We want to transfer the data from
the data sheet to the Excel files, which we call Alias files.<span style="mso-spacerun: yes;"> </span>We will use the Alias files to
automatically generate documentation, code, and IDE support. </div>
<h1>
Example:</h1>
<div class="MsoNormal">
Here’s the SFR definition for ADC0CF from the data sheet.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAEyCzEjNuMRfggtTLrHuirQUtkTYV7QC88JbkA7L-wL7UcXTS9TOq8crN4rE3tnFmoMvRxpj-tpB6-BKf8vU3vBPIf6KpRYxOlhXwT0TuHQj05eHb2O1viDzrh80v1F8cLi-3nKulmL76/s1600/image001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAEyCzEjNuMRfggtTLrHuirQUtkTYV7QC88JbkA7L-wL7UcXTS9TOq8crN4rE3tnFmoMvRxpj-tpB6-BKf8vU3vBPIf6KpRYxOlhXwT0TuHQj05eHb2O1viDzrh80v1F8cLi-3nKulmL76/s1600/image001.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkXLAIHrXjFqys32BQDK8_A06gSXbn0VyxGmhdVh2CtsmiOqGthq-CQ0Zw-Nrf8VICxOVcxslDEv7NiHKzzASiAC0XetFgZAefUfp6UbIXGRoQNUzv86CvgM97dvx6vKzAeZ5KdQUGoFnh/s1600/image003.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a></div>
<div class="MsoNormal">
<span style="mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
Here is the same information entered into the Excel File:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkXLAIHrXjFqys32BQDK8_A06gSXbn0VyxGmhdVh2CtsmiOqGthq-CQ0Zw-Nrf8VICxOVcxslDEv7NiHKzzASiAC0XetFgZAefUfp6UbIXGRoQNUzv86CvgM97dvx6vKzAeZ5KdQUGoFnh/s1600/image003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkXLAIHrXjFqys32BQDK8_A06gSXbn0VyxGmhdVh2CtsmiOqGthq-CQ0Zw-Nrf8VICxOVcxslDEv7NiHKzzASiAC0XetFgZAefUfp6UbIXGRoQNUzv86CvgM97dvx6vKzAeZ5KdQUGoFnh/s1600/image003.png" /></a></div>
<div class="MsoNormal">
<span style="mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">Special Notes from
the SFR definition</b></div>
<div class="MsoNormal">
10) The SFR address and page information does not need to be
stored in the Excel file.<span style="mso-spacerun: yes;">
</span>When we generate documentation and IDE support files, the addresses will
come from a different file.</div>
<div class="MsoNormal">
11) The SFR Definition number is not stored in the Excel
file.</div>
<div class="MsoNormal">
12) We have a special mechanism for documenting functions in
the Description field.<span style="mso-spacerun: yes;"> </span>For now, you
can simply do an approximation of the equation in the text.</div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">Special Notes from
the Excel file</b></div>
<div class="MsoNormal">
13) <b style="mso-bidi-font-weight: normal;">Module Name</b>.<span style="mso-spacerun: yes;"> </span>Choose any name that is short and
appropriate for now.<span style="mso-spacerun: yes;"> </span>Use names
similar to the corresponding 32-bit peripheral if available.</div>
<div class="MsoNormal">
14) <b style="mso-bidi-font-weight: normal;">Offset</b>.<span style="mso-spacerun: yes;"> </span>In the Excel file, each register must
have a unique offset.<span style="mso-spacerun: yes;"> </span>Start at 0x00
and increment by 1 for each register.</div>
<div class="MsoNormal">
15)<span style="mso-spacerun: yes;"> </span>In
this example, the reset value for the AD0SC bits is 11111b, so the reset value
is 31, which gets entered into each row.</div>
<h1>
Consideration:</h1>
<div class="MsoNormal">
From above requirements, we can see that is hard work with copy
and paste by hand. We need to think about make a code to automatically get
peripheral register contents and write into excel files with proper style
requirement. However, we can see some fields need human intelligence to name
the field. That is Okay, we can leave them there and fill by hand later. And
most of fields can be done by code.</div>
<h2>
Language:</h2>
<div class="MsoNormal">
Python is popular in company, so Python3 is our prefer
script language. </div>
<h3>
Parse data sheet:</h3>
<div class="MsoNormal">
Since data sheet is PDF file. I have studied background
knowledge of python parse PDF file. And finally I found this blog, <a href="http://chuckin-py.blogspot.com/2010/03/hacking-pdf-with-python.html">http://chuckin-py.blogspot.com/2010/03/hacking-pdf-with-python.html</a>.
The author planed to do similar thing as I want. But he found that is hard to achieve
it. I didn’t know PDF file even has not table. So I need other file type. And
we have .txt file, it is easy to access. <span style="mso-spacerun: yes;"> </span>We will have a look in it in detail
later. </div>
<h2>
Access Excel 2007 file </h2>
<div class="MsoNormal">
Compared several 3<sup>rd</sup> party tools, I choose <span class="SpellE">openpyxl</span> since it supports excel 2007 and python Here are
the steps to install it in your PC, of course you already installed Python 3.</div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l2 level1 lfo8; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Get distribut0.6.28 </div>
<div class="MsoListParagraphCxSpMiddle">
http://pypi.python.org/pypi/distribute</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l2 level1 lfo8; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Get <span class="SpellE">openpyxl</span> 1.5.8 for
python 3</div>
<div class="MsoListParagraphCxSpMiddle">
https://bitbucket.org/hjunes/openpyxl/</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l2 level1 lfo8; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Install distribut0.6.28</div>
<div class="MsoListParagraphCxSpMiddle">
$ <span class="GramE">setup.py</span> install</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l2 level1 lfo8; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Install <span class="SpellE">openpyxl</span> 1.5.8
for python3</div>
<div class="MsoListParagraphCxSpLast">
$ <span class="GramE">setup.py</span> install</div>
<h1>
Creating Excel file</h1>
<h2>
Excel file requirement:</h2>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l1 level1 lfo3; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Two sheets.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo3; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Font Calibri, size 11</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo3; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>First row is freeze pane, and Font is “bold”</div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l1 level1 lfo3; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Each register first row is filled with yellow
color</div>
<h2>
Achievement by <span class="SpellE">openpyxl</span>:</h2>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l5 level1 lfo6; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Two sheets.</div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis"><span style="mso-spacerun: yes;"> </span><span class="SpellE"><span class="GramE">wb</span></span>
= Workbook()</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis"><span style="mso-spacerun: yes;"> </span><span class="SpellE"><span class="GramE">ws</span></span>
= <span class="SpellE">wb.worksheets</span>[0]</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis"><span style="mso-spacerun: yes;"> </span><span class="SpellE">ws.title</span> =
'version'</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis"><span style="mso-spacerun: yes;"> </span><span class="SpellE"><span class="GramE">ws</span></span>
= <span class="SpellE">wb.create_sheet</span>()</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis"><span style="mso-spacerun: yes;"> </span><span class="SpellE">ws.title</span> =
"<span class="SpellE">Base_alias</span>"</span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l5 level1 lfo6; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Font Calibri, size 11</div>
<div class="MsoListParagraphCxSpMiddle">
For excel 2007, default font is Calibri,
and default font size is 11. </div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l5 level1 lfo6; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>First row is freeze pane, and Font is “Bold”</div>
<div class="MsoListParagraphCxSpMiddle">
<span style="mso-spacerun: yes;"> </span><span class="SpellE"><span class="MsoSubtleEmphasis">ws._freeze_panes</span></span><span class="MsoSubtleEmphasis"> = 'A2'</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="mso-spacerun: yes;"> </span><span class="SpellE"><span class="GramE"><span class="MsoSubtleEmphasis">ws.cell</span></span></span><span class="GramE"><span class="MsoSubtleEmphasis">(</span></span><span class="MsoSubtleEmphasis">'%<span class="SpellE">s%s</span>'%(<span class="SpellE">col</span>, 1)).<span class="SpellE">style.font.bold</span> = True</span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l5 level1 lfo6; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Each register first row is filled with yellow
color</div>
<div class="MsoListParagraphCxSpMiddle">
<span class="SpellE"><span class="GramE"><span class="MsoSubtleEmphasis">ws.cell</span></span></span><span class="GramE"><span class="MsoSubtleEmphasis">(</span></span><span class="MsoSubtleEmphasis">'%<span class="SpellE">s%s</span>'%(<span class="SpellE">col</span>, row)).<span class="SpellE">style.fill.fill_type</span> = <span class="SpellE">Fill.FILL_SOLID</span></span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="SpellE"><span class="GramE"><span class="MsoSubtleEmphasis">ws.cell</span></span></span><span class="GramE"><span class="MsoSubtleEmphasis">(</span></span><span class="MsoSubtleEmphasis">'%<span class="SpellE">s%s</span>'%(<span class="SpellE">col</span>, row)).<span class="SpellE">style.fill.start_color.index</span> = <span class="SpellE">Color.YELLOW</span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l5 level1 lfo6; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">5.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Write data into cell</div>
<div class="MsoListParagraphCxSpLast">
<span class="SpellE"><span class="GramE"><span class="MsoSubtleEmphasis">ws.cell</span></span></span><span class="GramE"><span class="MsoSubtleEmphasis">(</span></span><span class="MsoSubtleEmphasis">'%<span class="SpellE">s%s</span>'%(<span class="SpellE">col</span>, row)).value = <span class="SpellE">row_data</span>[<span class="SpellE">i</span>]</span></div>
<h1>
Parse .txt file</h1>
<h2>
.txt file overlook</h2>
<div class="MsoNormal">
Here is the example opened by notepad+<span class="GramE">+ ,</span>
it looks like:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCL6O9nw9hN6YCOA1M81qpurh_4KVrJ-PSkhEmCizUA4Pq38-uADqXV7OBFHHuezUtFPHNqAz-94mIYdvNCnkeo4DwI3k4MSj09E2LmZ71JlK0_F5VFY8rdJWaPJlF06kvDvb-tt1X4fn8/s1600/image005.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCL6O9nw9hN6YCOA1M81qpurh_4KVrJ-PSkhEmCizUA4Pq38-uADqXV7OBFHHuezUtFPHNqAz-94mIYdvNCnkeo4DwI3k4MSj09E2LmZ71JlK0_F5VFY8rdJWaPJlF06kvDvb-tt1X4fn8/s1600/image005.png" /></a></div>
<div class="MsoNormal">
<span style="mso-no-proof: yes;"><br /></span></div>
<div class="MsoNormal">
<br />
It is not so regular, isn’t it?</div>
<h2>
Analysis txt file </h2>
<div class="MsoNormal">
The arrow in the snapshot is <span class="GramE">tab(</span>‘\t’),
and CRLF is ‘\n’.</div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l8 level1 lfo9; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Every<span style="mso-spacerun: yes;">
</span>register description start with "SFR Definition" </div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l8 level1 lfo9; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Register bit type field start with 'Type\t'.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l8 level1 lfo9; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Register bit reset field start with 'Reset\t'</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l8 level1 lfo9; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Register description start with 'Bit<span style="mso-tab-count: 1;"> </span>Name<span style="mso-tab-count: 1;"> </span>Function'</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l8 level1 lfo9; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">5.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>We have several situations in description part.</div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 72.0pt; mso-add-space: auto; mso-list: l8 level2 lfo9; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">a.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>“7\t”</div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 72.0pt; mso-add-space: auto; mso-list: l8 level2 lfo9; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">b.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>“7:0\t”</div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 72.0pt; mso-add-space: auto; mso-list: l8 level2 lfo9; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">c.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>“1x:” and “01:”</div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 72.0pt; mso-add-space: auto; mso-list: l8 level2 lfo9; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">d.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Description row</div>
<div class="MsoListParagraphCxSpLast" style="margin-left: 72.0pt; mso-add-space: auto; mso-list: l8 level2 lfo9; text-indent: -18.0pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">e.<span style="font: 7.0pt "Times New Roman";">
</span></span></span>Double “\n” indicates reach end of this
register.</div>
<h2>
Handle data in txt file </h2>
<div class="MsoNormal">
With Python3 internal function we can deal with all string
relate context.<br />
<br />
<b><span style="font-size: large;">Source code</span></b><br />
https://github.com/MarkDing/Txt2xlsx.git<br />
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-48785280665014568772012-10-11T23:20:00.002-07:002012-10-11T23:20:53.956-07:00Access excel file by Python I have a task to extract register data from SOC spec and fill in excel file. I chosen Python script language to do this automatic job. I have found two 3rd party tools xlwt and openpyxl.<br />
I have tried xlwt, it has well documentation and easier to operation. However, it has two major weakness, first, it only support up to excel 2003; second, it doesn't support Python 3 which is default version in my group. So I turn to Openpyxl, before that, I would like record some information for xlwt which might be useful for other who don't care about those two weakness I mentioned above.<br />
<br />
http://www.python-excel.org/<br /><br />1. xlrd<br />* http://pypi.python.org/pypi/xlrd<br />* Version 0.8.0<br />* c:\python26\python.exe setup.py install<br /><br />2. xlwt<br />* http://pypi.python.org/pypi/xlwt<br />* version 0.7.4<br />* c:\python26\python.exe setup.py install<br /><br />
3. Sample code<br />
These same code can generate all style I needed in my task.<br />
<blockquote class="tr_bq">
</blockquote>
<blockquote>
<span style="font-size: x-small;">from xlwt import Workbook, easyxf<br />from xlwt.Utils import rowcol_to_cell<br /><br />row0_style = easyxf(<br /> 'font: name Calibri, bold True, height 220;'<br /> )<br />reg_row_style = easyxf(<br /> 'pattern: pattern solid, fore_colour yellow;'<br /> 'font: name Calibri, height 220;'<br /> )<br />common_style = easyxf(<br /> 'font: name Calibri, height 220;'<br /> )<br /><br />row0_data = [<br /> 'Module',<br /> 'Register',<br /> 'Offset',<br /> 'Bit Num',<br /> 'Bit',<br /> 'Bit Access',<br /> 'Bit Field Reset',<br /> 'Enum Name',<br /> 'Enum Value',<br /> 'Special',<br /> 'Short Name',<br /> 'Description',<br /> ]<br /><br />w = Workbook()<br />#sheet1 = w.add_sheet('version')<br /><br />sheet2= w.add_sheet('Base_alias')<br />sheet2.panes_frozen = True<br />sheet2.remove_splits = True<br />sheet2.horz_split_pos = 1<br />for col in range(12):<br /> sheet2.write(0,col,row0_data[col],row0_style)<br />for col in range(12):<br /> sheet2.write(1,col,rowcol_to_cell(1,col),reg_row_style)<br />for col in range(12):<br /> for row in range(2,80):<br /> sheet2.write(row,col,rowcol_to_cell(row,col),common_style)<br />w.save('panes.xls')</span></blockquote>
<br />Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-34535503578909342622012-08-05T20:46:00.002-07:002012-08-05T20:48:14.451-07:00USB VBUS over voltage issue.We encounter USB VBUS over voltage issue. With my friend Leo’s great help! I was able to figure out what happens on this issue.<br />
<br />
· When we plug in USB cable, we will see over voltage on VBUS, below figure shows peak voltage approach 11.63v, which is much high than VBUS pad tolerance. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_svVuatYCMxCkee7H078mxqEGffIXPkwVwZrMMPHc1hva_iiO6_DYBVKo2-lEjskc4LR-73veGl4FGSA5Si66BDEZ1VQ7F096_G6uvyugirXTqjD_9WaPW237yjvdV__UcMRrfxiNkbjU/s1600/image001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" eda="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_svVuatYCMxCkee7H078mxqEGffIXPkwVwZrMMPHc1hva_iiO6_DYBVKo2-lEjskc4LR-73veGl4FGSA5Si66BDEZ1VQ7F096_G6uvyugirXTqjD_9WaPW237yjvdV__UcMRrfxiNkbjU/s1600/image001.png" /></a></div>
· The USB chip, VBUS maximum rating is 5.8V and it add an avalanche diode between VBUS and GND. I have checked the spec of SP0503BA; the clamp voltage is 6.8V typical value which is higher than VBUS maximum rating.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8YgFcmg0vBwKfYiyYUcamHF5k-aM8uJ5gA0T0eOHY5jocb3_FMDJvsHoLEUsWvP39Kb0TkPNcAdzROOvb4mN3r-bsbUdOEciri05-aJtf-lRScCG4RJp6Y54aUq_R5CubCZbofEsfrXNg/s1600/image002.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" eda="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8YgFcmg0vBwKfYiyYUcamHF5k-aM8uJ5gA0T0eOHY5jocb3_FMDJvsHoLEUsWvP39Kb0TkPNcAdzROOvb4mN3r-bsbUdOEciri05-aJtf-lRScCG4RJp6Y54aUq_R5CubCZbofEsfrXNg/s1600/image002.png" /></a></div>
<br />
· The voltage overshoot will always happen because all USB cables have inductance with them. Normally, the inductance is around 1uH to 10uH(Lout). We have 1.0uF ceramic input capacitor (Cin) on VBUS. When USB plug in, Cin will ramp up toward 5V input voltage. Once the voltage across Cin has reached the 5v, the energy stored in Lout will raise the voltage across Cin further above 5V. The voltage across Cin will eventually reach its peak and will then fall back to 5V. Refer to Linear Technology Application Note 88, entitled “Ceramic Input Capacitors Can Cause Overvoltage Transients” for a detailed discussion of this problem.<br />
<br />
· So I have made some tests on demo board. <br />
o I added a 10uH inductance in series with VBUS to simulate long USB cable.<br />
I used Agilent E3631A to supply 5v in this test. My desktop USB VBUS voltage is around 5.18v. So I set output voltage as 5.15V. And the maximum voltage I captured on VBUS is 6.54V which is higher than VBUS pad voltage rating. Here is the waveform.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2uRqDTea7CzFzuIFy1fEmlr6hV_CH5WO8zfIiKmWtvHJpPG35Z5bhgnxjgbHO5T1xDsFgLiVYq0nQZ8iz4vwV1SsLm-enXMOYOTQ-3TnGxK4_P3COue6bTVx3xpi_eeGrHfa95XaVgoY-/s1600/image003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" eda="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2uRqDTea7CzFzuIFy1fEmlr6hV_CH5WO8zfIiKmWtvHJpPG35Z5bhgnxjgbHO5T1xDsFgLiVYq0nQZ8iz4vwV1SsLm-enXMOYOTQ-3TnGxK4_P3COue6bTVx3xpi_eeGrHfa95XaVgoY-/s1600/image003.png" /></a></div>
<br />
<br />
<br />
<div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
o And then I added 1 Ohm resistor in series with ceramic capacitor C6 in CP2104 demo board to decrease the inrush current. And with the modification, the maximum voltage on VBUS is 5.74V which is lower than VBUS voltage rating. Below is the SCH.</div>
<div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHBtt5R0jXok-aHLka9S8BYvcW1eE13jgA-Slfo9vWoFtRDwadPYwvB59bApDvhbBbXjUJV4mK7vsuLQBsufdMYyudA3KkxatlHRNSy8pTk02KLZ23SQ1uV5faOOjebG0mHBhzJ0QTvXZh/s1600/image004.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" eda="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHBtt5R0jXok-aHLka9S8BYvcW1eE13jgA-Slfo9vWoFtRDwadPYwvB59bApDvhbBbXjUJV4mK7vsuLQBsufdMYyudA3KkxatlHRNSy8pTk02KLZ23SQ1uV5faOOjebG0mHBhzJ0QTvXZh/s1600/image004.png" /></a></div>
<br />
<br />
<br />
<br />
<div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
o There is an explanation on this.” The long cable lengths of most wall adapters and USB cables make them especially susceptible to this problem. To bypass the USB pin and the wall adapter input, add a 1Ω resistor in series with a ceramic capacitor to lower the effective Q of the network and greatly reduce the ringing. A tantalum, OS-CON, or electrolytic capacitor can be used in place of the ceramic and resistor, as their higher ESR reduces the Q, thus reducing the voltage ringing.”</div>
<div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
o Here is the waveform I captured</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_e6hi2POg3gQiqHOyB3rxLRDqWbGb9KDWHAgIl9J4XzC7sKW_f1PtXYwxtdd39ng7ivunZi2xT2d-uAF6Hvz-XsEwvuoGYi18CFP-LNzej5bI8hefwdvQHz08ZyhalGZNmkj_PTJNSlKu/s1600/image005.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" eda="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_e6hi2POg3gQiqHOyB3rxLRDqWbGb9KDWHAgIl9J4XzC7sKW_f1PtXYwxtdd39ng7ivunZi2xT2d-uAF6Hvz-XsEwvuoGYi18CFP-LNzej5bI8hefwdvQHz08ZyhalGZNmkj_PTJNSlKu/s1600/image005.png" /></a></div>
<br />
<br />
o This trace shows the clean response resulting from the addition of the 1Ω resistor.<br />
<br />
<br />
<br />
<br />
<br />
<div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;">
<br /></div>Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com1tag:blogger.com,1999:blog-6138180379582869534.post-81619853481095141212012-07-26T03:34:00.000-07:002012-07-26T03:35:19.021-07:00Debug Hard Fault Error in Arm Cortex M3<br />
<div class="MsoNormal">
I was assigned a
USB Audio project validation task. Run the code and every time I play music
from PC, the code enters HardFault handler. The Hardware environment is
SiM3u164, ARM cortex M3 core.</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;">void</span></b><span style="font-family: 'Courier New'; font-size: 10pt;"> <b>HardFault_Handler</b>(</span><b><span style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;">void</span></b><span style="font-family: 'Courier New'; font-size: 10pt;">) </span><span style="font-family: 'Courier New'; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: silver; font-family: 'Courier New'; font-size: 10pt;">{</span><span style="font-family: 'Courier New'; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">
</span><b><span style="color: #642880; font-family: 'Courier New'; font-size: 10pt;">printf</span></b><span style="font-family: 'Courier New'; font-size: 10pt;">(</span><span style="color: #2a00ff; font-family: 'Courier New'; font-size: 10pt;">"HardFault_Handler\n"</span><span style="font-family: 'Courier New'; font-size: 10pt;">);</span><span style="font-family: 'Courier New'; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">
</span><span style="color: #3f7f5f; font-family: 'Courier New'; font-size: 10pt;">/*NO SECOND LEVEL HANDLER SPECIFIED (halt USED)*/</span><span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="font-family: 'Courier New'; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">
halt();</span><span style="font-family: 'Courier New'; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">}<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">It is a good opportunity for me to solve HardFault
issue on a total new and big project. Let’s start it.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
1.<span style="font-size: 7pt;">
</span>The first thing is to check value in Stack and
PC.</div>
<div class="MsoListParagraphCxSpMiddle">
Sp=0x20007e18, PC=0x0000b37C</div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
2.<span style="font-size: 7pt;">
</span>Open the map file, find 0x0000b37c</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">.text.HardFault_Handler<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
0x0000b37c 0x18
./src/generated/gCPU.o<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
0x0000b37c
HardFault_Handler<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst">
Of course it is HardFault_Handler address,
it is useless for us.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
3.<span style="font-size: 7pt;">
</span>Open memory view, type 0x20007e18, we got
context in stack memory area.</div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: .75in; mso-add-space: auto;">
<span style="color: red;">0x0,0x1,0x5079,0x20001778,0x0,0x5145,0xc06328f1,0x20000032…<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: .75in; mso-add-space: auto;">
In ARM cortex M3, Flash address range is 0x00-0x3FFFF; SRAM address range
is 0x20000000-0x20007FFF. So we can see there are two addresses in stack,
0x5079 and 0x5145, there are the last function executed. Let’s check the map
file again.</div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
4.<span style="font-size: 7pt;">
</span>0x5079 is 0x5078 due to thumb mode; we can see
it is si32UsbTrace_poller. And 0x5145 is in the range of si32Usb_initiliaze_trace.
The file is si32UsbDebug.o</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">.text.si32UsbTrace_poller<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
0x00005078 0x7c
./src/si32Library/si32UsbComponent/si32UsbCoreComponent/si32UsbDebug.o<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
0x00005078
si32UsbTrace_poller<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;"> .text.si32Usb_initialize_trace<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
0x000050f4 0x58
./src/si32Library/si32UsbComponent/si32UsbCoreComponent/si32UsbDebug.o<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
0x000050f4
si32Usb_initialize_trace<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;"> .text.si32UsbTrace<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
0x0000514c 0xb0
./src/si32Library/si32UsbComponent/si32UsbCoreComponent/si32UsbDebug.o<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: 'Courier New'; font-size: 8pt; line-height: 115%;">
0x0000514c
si32UsbTrace</span><span style="font-size: 8pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
5.<span style="font-size: 7pt;">
</span>Here is the si32Usb_initalize_trace() function
in si32UsbDebug.c, we can see si32UsbTrace_poller was called here.</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #3f7f5f; font-family: 'Courier New'; font-size: 8pt;">//------------------------------------------------------------------------------</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #3f7f5f; font-family: 'Courier New'; font-size: 8pt;">// initialize the static memory
allocations required by all instances.</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">void</span></b><span style="font-family: 'Courier New'; font-size: 8pt;"> <b>si32Usb_initialize_trace</b>(</span><b><span style="color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">void</span></b><span style="font-family: 'Courier New'; font-size: 8pt;">)</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">{</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
</span><span style="color: #3f7f5f; font-family: 'Courier New'; font-size: 8pt;">// create a queue of debug logging messages that can be</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
</span><span style="color: #3f7f5f; font-family: 'Courier New'; font-size: 8pt;">// stored in sequence, but printed in the background</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
si32QueueObject_initialize(&si32UsbTraceQueue,</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
si32UsbTraceCapacity,</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;"> </span><b><span style="color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">sizeof</span></b><span style="font-family: 'Courier New'; font-size: 8pt;">(si32UsbTraceQueueMemory[0]),</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;"> si32UsbTraceQueueMemory);</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
</span><span style="color: #3f7f5f; font-family: 'Courier New'; font-size: 8pt;">// reschedule this poller</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: silver; font-family: 'Courier New'; font-size: 8pt;">
si32RunLoopObject_post_work_request(si32GetCurrentRunLoop(),</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;"> 1, </span><span style="color: #3f7f5f; font-family: 'Courier New'; font-size: 8pt;">// <u>lo</u> <u>prio</u></span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
si32UsbTrace_poller,</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
&si32UsbTraceQueue,</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;"> NULL);</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">}</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
6.<span style="font-size: 7pt;">
</span>Move cursor on
si32RunLoopObject_post_work_request(), press F2 to expand the macro.(I am using
Precision32) Here is the macro, can see it execute function si32GetCurrentRunLoop.</div>
<div class="MsoNormal">
<span style="background-color: silver; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">((si32RunLoopObject
*)((si32GetCurrentRunLoop())))->runLoopObject.functions->post_work_request(((si32GetCurrentRunLoop())),
(1), (si32UsbTrace_poller), (&si32UsbTraceQueue), (((</span><b><span style="background-color: silver; color: #7f0055; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;">void</span></b><span style="background-color: silver; font-family: 'Courier New'; font-size: 10pt; line-height: 115%;"> *)0)))</span><span style="font-family: 'Courier New'; font-size: 10pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
7.<span style="font-size: 7pt;">
</span>Move cursor on
si32GetCurrentRunLoop(), press F3 jump to declaration, it return a _the_current_run_loop,
check the value, it is zero. It return a NULL pointer which cause HardFault
error!<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #005032; font-family: 'Courier New'; font-size: 10pt;">si32RunLoopObject</span><span style="font-family: 'Courier New'; font-size: 10pt;">* <b><span style="background-color: silver;">si32GetCurrentRunLoop</span></b>()</span><span style="font-family: 'Courier New'; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">{</span><span style="font-family: 'Courier New'; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">
</span><b><span style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;">return</span></b><span style="font-family: 'Courier New'; font-size: 10pt;"> <a href="http://www.blogger.com/blogger.g?blogID=6138180379582869534" name="OLE_LINK2"></a><a href="http://www.blogger.com/blogger.g?blogID=6138180379582869534" name="OLE_LINK1">_the_current_run_loop</a>;</span><span style="font-family: 'Courier New'; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">}</span><span style="font-family: 'Courier New'; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
8.<span style="font-size: 7pt;">
</span>Solution.</div>
<div class="MsoListParagraphCxSpLast">
The fastest way is disable execute si32Usb_initialize_trace().
Look up it, only si32UsbTrace, just disable this functional. </div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">void</span></b><span style="font-family: 'Courier New'; font-size: 8pt;"> <b><span style="background-color: silver;">si32UsbTrace</span></b>(</span><b><span style="color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">const</span></b><span style="font-family: 'Courier New'; font-size: 8pt;"> </span><b><span style="color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">char</span></b><span style="font-family: 'Courier New'; font-size: 8pt;"> * fmt, ...)</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">{</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
</span><span style="color: #005032; font-family: 'Courier New'; font-size: 8pt;">va_list</span><span style="font-family: 'Courier New'; font-size: 8pt;"> ap;</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
_begin_critical_section();</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
va_start(ap, fmt);</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
</span><b><span style="color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">static</span></b><span style="font-family: 'Courier New'; font-size: 8pt;"> </span><b><span style="color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">volatile</span></b><span style="font-family: 'Courier New'; font-size: 8pt;"> bool bInit=false;</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="background-color: white; color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">#if</span></b><span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> 0</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> </span><b><span style="background-color: white; color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">if</span></b><span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;">(!bInit)</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> {</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> bInit=true;</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> si32Usb_initialize_trace();</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> }</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> </span><b><span style="background-color: white; color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">if</span></b><span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;">(!si32QueueObject_is_full(&si32UsbTraceQueue))</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> {</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> si32UsbTraceType trace;</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> trace.fmt=fmt;</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> trace.arg = va_arg(ap,
uint32_t);</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;">
si32QueueObject_write(&si32UsbTraceQueue, &trace );</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> _end_critical_section();</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> }</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> </span><b><span style="background-color: white; color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">else</span></b><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> {</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> _end_critical_section();</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> fputc(</span><span style="background-color: white; color: #2a00ff; font-family: 'Courier New'; font-size: 8pt;">'*'</span><span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;">,stdout);</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: 8pt;"> }</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="background-color: white; color: #7f0055; font-family: 'Courier New'; font-size: 8pt;">#endif</span></b><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">
va_end(ap);</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 8pt;">}</span><span style="font-family: 'Courier New'; font-size: 8pt;"><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
9.<span style="font-size: 7pt;">
</span>Validate.</div>
<div class="MsoListParagraphCxSpMiddle">
Re-build the code and run, play music from
PC, I can hear audio from device speaker. It is done.</div>
<div class="MsoListParagraphCxSpLast">
<br /></div>
<div class="MsoNormal">
<br /></div>Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0tag:blogger.com,1999:blog-6138180379582869534.post-71489029762446700542012-06-06T02:36:00.000-07:002012-06-27T19:24:17.461-07:00Make own bootloader for Arm Cortex-M3<br />
<h1>
1 Bootloader overview</h1>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>A Bootloader is a small application that is used to load new user applications to devices. After it is loaded, the new user application is able to run in the MCU. It works with two modes, user application and Bootloader mode. </div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>We are discussing common way to implement Bootloader on your own Arm Cortez M3. And we choose Silicon labs SIM3U167 MCU as example for making Bootloader. </div>
<h1>
2 Bootloader design method</h1>
<h2>
2.1 Bootloader need to run in SRAM</h2>
<h3>
2.1.1 Bootloader behavior</h3>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>Bootloader is an application which runs from internal flash, in case of update Bootloader itself requirement, the Bootloader code needed to be copied into internal SRAM and run.</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>The Bootloader code address need to set in SRAM in link file</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>The vector table entry needs to update from flash to SRAM after copying Bootloader into SRAM.</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>The Reset vector address we want to keep its original address, since it is hardware behavior.</li>
</ul>
<h3>
2.1.2 Arm Cortex M3 internal memory map</h3>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Internal flash address (0x00000000-0x1FFFFFFF).</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Internal SRAM address (0x20000000-0x3FFFFFFF).</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Peripherals address (0x40000000-0x5FFFFFFF).</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>System levels address (0xE0000000-0xFFFFFFFF).</li>
</ul>
<div class="MsoListParagraphCxSpLast">
So base on above memory, we need to copy code from internal flash address to internal SRAM address. And access UART peripheral register in Peripherals address, and change vector table address need to access register in System levels address.</div>
<h3>
2.1.3 Link file </h3>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>To make sure Bootloader code is located in SRAM, we need to specific the address setting in link file.<span style="mso-spacerun: yes;"> </span>Now we have a Bootloader_link.ld as our link file. We would talk detail about how to write link file, we assume that you already know the basic knowledge about link file.</div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>.text 0x20000000 : AT (0x00000000)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"> </span>. = ALIGN(4);</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>_text = .;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span><a href="http://www.blogger.com/" name="OLE_LINK2"></a><a href="http://www.blogger.com/" name="OLE_LINK1"><span style="mso-bookmark: OLE_LINK2;">KEEP(*(.isr_vector))</span></a></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>*(.text*)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>*(.rodata*)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>_etext = .;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span></div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>The first line “<span style="font-family: "Courier New"; font-size: 10pt; line-height: 115%;">.text 0x20000000 : AT (0x00000000)</span>” means .text section load address start from 0x20000000, store address from 0x00000000.<span style="mso-spacerun: yes;"> </span></div>
<div class="MsoNormal" style="text-indent: 9pt;">
Inside the description, we put “.isr_vector”, *(.text*) and *(.rodata*) in .text section. The “.isr_vector” is vector entry; we put it in front of Bootloader code.</div>
<div class="MsoNormal" style="text-indent: 9pt;">
And then we have other two sections .data and .bss</div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>.data 0x20000000 + SIZEOF(.text) : AT (LOADADDR(.text) + SIZEOF(.text))</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>_data = .;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>*(.data*)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>_edata = .;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>.bss 0x20000000 + SIZEOF(.text) + SIZEOF(.data) :</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>AT (LOADADDR(.data) + SIZEOF(.data))</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>_bss = .;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>*(.bss*)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>*(COMMON)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>_ebss = .;</span></div>
<div class="MsoNormal" style="text-indent: 24pt;">
<span style="font-family: "Courier New"; font-size: 10pt; line-height: 115%;">}</span></div>
<div class="MsoNormal">
And now the link file is ready.</div>
<h3>
2.1.4 Vector table introduction. </h3>
<div class="MsoNormal">
By default Arm Cortex M3 vector table starts at memory address 0. The vector table can be relocated to other memory locations in the code or Random Access Memroy(RAM) region where the RAM is so that we can change the handlers during run time. This is down by settting a register in the NVIC called the vector table offset register (address 0xE000ED08). You need to have the following (at a minimum).</div>
<div class="MsoNoSpacing">
<span lang="ZH-CN" style="font-family: SimSun; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">•</span> Initial main stack pointer value</div>
<div class="MsoNoSpacing">
<span lang="ZH-CN" style="font-family: SimSun; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">•</span> Reset vector</div>
<div class="MsoNoSpacing">
<span lang="ZH-CN" style="font-family: SimSun; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">•</span> NMI vector</div>
<div class="MsoNoSpacing">
<span lang="ZH-CN" style="font-family: SimSun; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">•</span> Hard fault vector</div>
<div class="MsoNoSpacing">
<br /></div>
<h3>
2.1.5 Vector table in startup file</h3>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>We prepare startup_sim3u1xx.S for our startup file. In this file, we will have the vector table, code copy from flash to SRAM, jump to user application code. Let us have a look on vector table first. We can see .isr_vector in link file is the vector table section name.</div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.section</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> .isr_vector</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">Vectors:</span></b><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>0x20008000<span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// The initial stack pointer</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>ResetISR - 0x20000000<span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// The reset handler</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>NMI_Handler<span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// The NMI handler</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>HardFault_Handler<span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// The hard fault handler</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>Default_Handler<span style="mso-spacerun: yes;"> </span><span style="mso-tab-count: 1;"></span><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// The MPU fault handler</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>Default_Handler<span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// The bus fault handler</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>Default_Handler<span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// The usage fault handler</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>0<span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Reserved</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>0<span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Reserved</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>0<span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Reserved</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>0<span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Reserved</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>Default_Handler<span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// SVCall handler</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>Default_Handler<span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Debug monitor handler</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>0<span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Reserved</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>Default_Handler<span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// The PendSV handler</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.extern</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> SysTick_Handler</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.word</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SysTick_Handler<span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// The SysTick handler</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNoSpacing">
Note:</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Stack pointer we set is 0x20008000, that is because SIM3U167 internal SRAM size is 32KB (0x20000000-0x20007FFF). </li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Reset handler address we minus 0x20000000, that is because, Arm will check the value in second word and jump to address in it. Since all Bootloader code was locate at SRAM (0x20000000), but at the time power up, all the codes are in internal flash, and didn’t copy to SRAM yet. So we have to set ResetISR address point to flash in order Arm can execute code correctly.</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Other exception handlers. We need to keep some import exception handlers; we will see HardFault_Handler happens many times during the Bootloader development in case the address not matches.</li>
</ul>
<h3>
2.1.6 ResetISR implements.</h3>
<div class="MsoNormal">
We need to handle code that Arm will first execute, ResetISR. <span style="mso-spacerun: yes;"> </span>What does this function do?</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Copy code to SRAM and initialize variables.</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Initialize system hardware</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Check external pin status to run under Bootloader or user application mode.</li>
</ul>
<div class="MsoNormal" style="margin-left: 0.25in;">
Here is the cod structure of ResetISR</div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.globl</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>ResetISR</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>.thumb_func</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">ResetISR:</span></b><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>// Copy code from flash to SRAM</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl<span style="mso-spacerun: yes;"> </span>CopyCode2SRAM</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.extern</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> SystemInit</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl <a href="http://www.blogger.com/" name="OLE_LINK4"></a><a href="http://www.blogger.com/" name="OLE_LINK3"><span style="mso-bookmark: OLE_LINK4;">SystemInit</span></a></span><span style="mso-bookmark: OLE_LINK4;"></span><span style="mso-bookmark: OLE_LINK3;"></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Check if update is needed</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.extern</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <a href="http://www.blogger.com/" name="OLE_LINK6"></a><a href="http://www.blogger.com/" name="OLE_LINK5"><span style="mso-bookmark: OLE_LINK6;">check_update_requirement</span></a></span><span style="mso-bookmark: OLE_LINK6;"></span><span style="mso-bookmark: OLE_LINK5;"></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl<span style="mso-spacerun: yes;"> </span>check_update_requirement</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>cbz<span style="mso-spacerun: yes;"> </span>r0, RunUserCode</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.extern</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> main</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl main</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<h4>
2.1.6.1 Copy code to SRAM and initialize variables.</h4>
<div class="MsoNormal">
Let us take a look on CopyCode2SRAM function.</div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.text</span></b><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>.thumb_func</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">CopyCode2SRAM:</span></b><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Copy the text and data sections from flash to SRAM.</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>movs<span style="mso-spacerun: yes;"> </span>r0, #0x00000000</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>ldr<span style="mso-spacerun: yes;"> </span>r1, =0x20000000</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.extern</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> _bss</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>ldr<span style="mso-spacerun: yes;"> </span>r2, =_bss</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">copy_loop:</span></b><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>ldr<span style="mso-spacerun: yes;"> </span>r3, [r0], #4</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>str<span style="mso-spacerun: yes;"> </span>r3, [r1], #4</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>cmp<span style="mso-spacerun: yes;"> </span>r1, r2</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>blt<span style="mso-spacerun: yes;"> </span>copy_loop</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Zero fill the bss segment</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>movs<span style="mso-spacerun: yes;"> </span>r0, #0x00000000</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">.extern</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> _ebss</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>ldr<span style="mso-spacerun: yes;"> </span>r2, =_ebss</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">zero_loop:</span></b><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>str<span style="mso-spacerun: yes;"> </span>r0, [r1], #4</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>cmp<span style="mso-spacerun: yes;"> </span>r1, r2</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>blt<span style="mso-spacerun: yes;"> </span>zero_loop</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Set the vector table pointer to SRAM.</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>ldr<span style="mso-spacerun: yes;"> </span>r0, =0xe000ed08</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>ldr<span style="mso-spacerun: yes;"> </span>r1, =0x20000000</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>str<span style="mso-spacerun: yes;"> </span>r1, [r0]</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// set return address to SRAM and return</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>orr<span style="mso-spacerun: yes;"> </span>lr, lr, #0x20000000</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bx<span style="mso-spacerun: yes;"> </span>lr</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNoSpacing">
<span style="mso-spacerun: yes;"> </span>The code is very simple.</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>copy .text and .data from flash to SRAM</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Zero .bss segment in SRAM</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Relocate vector table address and return to SRAM to execute.</li>
</ul>
<div class="MsoNoSpacing">
Note:</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>_bss is defined in link file, which is address after .text and .data. So the copy_loop is copy code from flash to SRAM until it reaches _bss address. </li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>_ess is defined in linke file, which is address after .bss segment. So zero_lopp, just write “0” into SRAM follow the .text and .data segment, until it reaches _ebss address.</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>And finally, we write new vector table address (0x20000000) into register 0xe00ed08, and set return address to SRAM and return.</li>
</ul>
<h4>
2.1.6.2 Initialize system hardware</h4>
<div class="MsoNormal">
The idea is very simple too, set necessary hardware environment we need in startup file. For instance, we need to check GPIO status to choose running mode. We have to enable clock to GPIO and set the GPIO as input mode and something like that. I paste the example of SystemInit.</div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <b>mySystemInit</b>(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_WDTIMER_A_stop_counter (SI32_WDTIMER_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Enable the APB clock to the PB registers</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_CLKCTRL_A_enable_apb_to_modules_0(SI32_CLKCTRL_0, SI32_CLKCTRL_A_APBCLKG0_PB0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_PBSTD_A_set_pins_push_pull_output(SI32_PBSTD_1, 0x00000008);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_PBCFG_A_enable_crossbar_1(SI32_PBCFG_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_PBSTD_A_set_pins_digital_input(<span style="background: silver; mso-highlight: silver;">SI32_PBSTD_2</span>,0x00000300);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Enable the LED drivers (P2.10, P2.11)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_PBSTD_A_set_pins_push_pull_output(<span style="background: silver; mso-highlight: silver;">SI32_PBSTD_2</span>, 0x00000C00);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SysTick_Config(SystemCoreClock / 1000);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// set Priority for <u>Cortex</u>-M0 System Interrupts.</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>NVIC_SetPriority(</span><i><span style="color: #0000c0; font-family: "Courier New"; font-size: 10pt;">SysTick_IRQn</span></i><span style="color: black; font-family: "Courier New"; font-size: 10pt;">, (1 << __NVIC_PRIO_BITS) - 1);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal">
<span style="color: black; font-family: "Courier New"; font-size: 10pt; line-height: 115%;">}</span></div>
<h4>
2.1.6.3 Check external pin status to run under Bootloader or user application mode</h4>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>The code call <i style="mso-bidi-font-style: normal;">check_update_requirement</i> <span style="color: black; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">to check GPIO status, if the GPIO is high, we enter into user application mode; if the GPIO is low, we enter into Bootloader mode. Let’s check user application mode entry code.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>.thumb_func</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">RunUserCode:</span></b><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Set the vector table address to user code address.</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>ldr<span style="mso-spacerun: yes;"> </span>r0, =<a href="http://www.blogger.com/" name="OLE_LINK8"></a><a href="http://www.blogger.com/" name="OLE_LINK7"><span style="mso-bookmark: OLE_LINK8;">USER_CODE_ADDRESS</span></a></span><span style="mso-bookmark: OLE_LINK8;"></span><span style="mso-bookmark: OLE_LINK7;"></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>ldr<span style="mso-spacerun: yes;"> </span>r1, =0xe000ed08</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>str<span style="mso-spacerun: yes;"> </span>r0, [r1]</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Update stack pointer from user code vector table</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>ldr<span style="mso-spacerun: yes;"> </span>r1, [r0]</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>mov<span style="mso-spacerun: yes;"> </span>sp, r1</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Load user code reset handler and jump to the user code</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>ldr<span style="mso-spacerun: yes;"> </span>r0, [r0, #4]</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="text-indent: 24pt;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt; line-height: 115%;">bx<span style="mso-spacerun: yes;"> </span>r0</span></div>
<div class="MsoNormal">
Yeah, we have to relocate vector table if we want run user application. Note we have a macro “<span style="color: black; font-family: "Courier New"; font-size: 10pt; line-height: 115%;">USER_CODE_ADDRESS</span>” which is user application start address. At the end we load user code reset handler and jump to the user code.</div>
<div class="MsoNormal">
OK, we will talk about Bootloader mode in next couple sections.</div>
<h2>
2.2 Bootloader need to get UART work to communicate with PC host tool.</h2>
<div class="MsoNormal">
We choose UART interface as communication port with PC host since it is easier to implement. Just have a look on SIM3U167 reference manual, initialize UART peripherals, and set it as 115200 baud rate. Prepare UART send and received functions. <span style="mso-spacerun: yes;"> </span></div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>UART hardware peripherals initialization. Those codes can be generated by Silabs AppBuilder.</li>
</ul>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">Void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <b>UART0_initialize</b>(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_PBCFG_A_enable_crossbar_0(SI32_PBCFG_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// UART PINS TO PROPER CONFIG (TX = PB1.12, RX = PB1.13)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_PBSTD_A_set_pins_push_pull_output(SI32_PBSTD_1, 0x0001000);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_PBSTD_A_set_pins_digital_input(SI32_PBSTD_1, 0x00002000);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_PBSTD_A_write_pbskipen(SI32_PBSTD_0, 0x0000FFFF);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_PBSTD_A_write_pbskipen(SI32_PBSTD_1, 0x00000FFF);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// BRING OUT UART</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_PBCFG_A_enable_xbar0h_peripherals(SI32_PBCFG_0, SI32_PBCFG_A_XBAR0H_UART0EN);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// ENABLE UART0 CLOCK</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_CLKCTRL_A_enable_apb_to_modules_0(SI32_CLKCTRL_0,</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_CLKCTRL_A_APBCLKG0_UART0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// SETUP UART. BAUD RATE (9600 baud, APB = System Clock)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_enter_full_duplex_mode(SI32_UART_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_set_tx_baudrate(SI32_UART_0, (SystemCoreClock / (2 * UART_BAUD_RATE)) – 1);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_set_rx_baudrate(SI32_UART_0, (SystemCoreClock / (2 * UART_BAUD_RATE)) – 1);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// SETUP TX (8-bit, 1stop, no-parity)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_select_tx_data_length(SI32_UART_0, 8);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_enable_tx_start_bit(SI32_UART_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_enable_tx_stop_bit(SI32_UART_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_disable_tx_parity_bit(SI32_UART_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_select_tx_stop_bits(SI32_UART_0, </span><i><span style="color: #0000c0; font-family: "Courier New"; font-size: 10pt;">SI32_UART_A_STOP_BITS_1_BIT</span></i><span style="color: black; font-family: "Courier New"; font-size: 10pt;">);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_disable_tx_signal_inversion(SI32_UART_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_enable_tx(SI32_UART_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// SETUP RX</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_select_rx_data_length(SI32_UART_0, 8);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_enable_rx_start_bit(SI32_UART_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_enable_rx_stop_bit(SI32_UART_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_select_rx_stop_bits(SI32_UART_0, </span><i><span style="color: #0000c0; font-family: "Courier New"; font-size: 10pt;">SI32_UART_A_STOP_BITS_1_BIT</span></i><span style="color: black; font-family: "Courier New"; font-size: 10pt;">);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_disable_rx_signal_inversion(SI32_UART_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_select_rx_fifo_threshold_1(SI32_UART_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_enable_rx(SI32_UART_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal">
<span style="color: black; font-family: "Courier New"; font-size: 10pt; line-height: 115%;">}</span></div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>UART send and receive functions.</li>
</ul>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">Void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <b>uart_send_data</b>(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> *data, </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> count)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">while</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">(count--)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Block if the output buffer is full</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">while</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (<span style="background: silver; mso-highlight: silver;">SI32_UART_A_read_tx_fifo_count</span>(SI32_UART_0) >= 4);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Write character to the output buffer</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_UART_A_write_data_u8(SI32_UART_0, *data++);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <b>uart_get_data</b>(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> *data, </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> count)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> time_out;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">while</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">(count--)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>time_out = msTicks + UART_TIME_OUT;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">while</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">(SI32_UART_A_read_rx_fifo_count(SI32_UART_0) == 0)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">(time_out < msTicks)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">return</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> -1;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>*data++ = SI32_UART_A_read_data_u8(SI32_UART_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">return</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> 0;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal">
<span style="color: black; font-family: "Courier New"; font-size: 10pt; line-height: 115%;">}</span></div>
<h2>
2.3 Bootloader need to burn the firmware gets from PC host into internal flash.</h2>
<div class="MsoNormal">
The UART driver was ready. We need to write user application into flash and flash device driver is needed now.</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Flash hardware peripherals initialization.</li>
</ul>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">Void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <b>flash_initialize</b>(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// ENABLE FLASH CLOCK</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_CLKCTRL_A_enable_apb_to_modules_0(SI32_CLKCTRL_0,</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_CLKCTRL_A_APBCLKG0_FLCTRLCEN_ENABLED_U32);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// 1. Enable VDD Supply Monitor and set as a reset source</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_VMON_A_enable_vdd_supply_monitor(SI32_VMON_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_RSTSRC_A_enable_vdd_monitor_reset_source(SI32_RSTSRC_0);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">}</span></div>
<ul>
<li><span style="font-family: Symbol; font-size: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span><span style="color: black; font-family: "Courier New"; font-size: 10pt;">Flash operation functions</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></li>
</ul>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <b>flash_erase_page</b>(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> addr)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_exit_multi_byte_write_mode(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_write_wraddr(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>, addr);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_enter_flash_erase_mode(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_write_flash_key(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>, 0xA5);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_write_flash_key(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>, 0xF1);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_write_wrdata(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>, 0x0000);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">while</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">(SI32_FLASHCTRL_A_is_buffer_full(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>));</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <b>flash_write_data</b>(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> * c,</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> addr, </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> num)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> i;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">short</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> *buf = (</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">short</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">*)c;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_exit_flash_erase_mode(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_write_wraddr(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>, addr);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_enter_multi_byte_write_mode(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_write_flash_key(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>, 0xA5);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_write_flash_key(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>, 0xF2);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// Write all the half-words in the array</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">for</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">(i = 0; i < num / 2; i++)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_write_wrdata(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>, buf[i]);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">while</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">(SI32_FLASHCTRL_A_is_flash_busy(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>));</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">while</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">(SI32_FLASHCTRL_A_is_buffer_full(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>));</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_FLASHCTRL_A_write_flash_key(<span style="background: silver; mso-highlight: silver;">SI32_FLASHCTRL_0</span>, 0x5A);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">return</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> 0;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<h1>
3 Bootloader UART communication protocol</h1>
<h2>
3.1 We can define our own protocol as we like. Also choose exist one is suitable. We list a protocol below just for reference. From view of host side</h2>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Command package</li>
</ul>
<div style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; margin-left: 0.5in; margin-right: 0in; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding-bottom: 1pt; padding-left: 4pt; padding-right: 4pt; padding-top: 1pt;">
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
CMD </div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
CMD ^ 0xFF</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
Wait for ACK</div>
</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Address package</li>
</ul>
<div style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; margin-left: 0.5in; margin-right: 0in; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding-bottom: 1pt; padding-left: 4pt; padding-right: 4pt; padding-top: 1pt;">
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
ADDR3</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
ADDR2</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
ADDR1</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
ADDR0</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
CRC(=ADDR3^ADDR2^ADDR1^ADDR0)</div>
</div>
<div class="MsoListParagraphCxSpMiddle">
<br /></div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Write flash command</li>
</ul>
<div style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; margin-left: 0.5in; margin-right: 0in; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding-bottom: 1pt; padding-left: 4pt; padding-right: 4pt; padding-top: 1pt;">
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
CMD(0x31)</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
ADDR(address)</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
Wait for ACK</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
(LEN-1) & 0XFF</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
DATA0</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
…</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
DATA(LEN-1)</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
CRC(=DATA0^DATA1…^DATA(LEN-1))</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
Wait for ACK</div>
</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Read flash command</li>
</ul>
<div style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; margin-left: 0.5in; margin-right: 0in; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding-bottom: 1pt; padding-left: 4pt; padding-right: 4pt; padding-top: 1pt;">
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
CMD(0x11)</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
ADDR(address)</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
Wait for ACK</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
<a href="http://www.blogger.com/" name="OLE_LINK10"></a><a href="http://www.blogger.com/" name="OLE_LINK9"><span style="mso-bookmark: OLE_LINK10;">(LEN-1) & 0XFF</span></a></div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
CRC (((LEN-1) & 0XFF) ^ 0xFF)</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
Wait for ACK</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
DATA0</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
…</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
DATA(LEN-1)</div>
</div>
<div class="MsoListParagraphCxSpMiddle">
<br /></div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Erase flash command</li>
</ul>
<div style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; margin-left: 0.5in; margin-right: 0in; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding-bottom: 1pt; padding-left: 4pt; padding-right: 4pt; padding-top: 1pt;">
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
CMD(0x43)</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
LEN-1</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
SEC0</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
…</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
SEC(LEN-1)</div>
<div class="MsoListParagraphCxSpMiddle" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-border-bottom-alt: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-bottom-alt: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
CRC(SEC0^SEC1…^SEC(LEN-1))</div>
<div class="MsoListParagraphCxSpLast" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; margin-left: 0in; mso-add-space: auto; mso-border-alt: solid windowtext .5pt; mso-border-between: .5pt solid windowtext; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-padding-between: 1.0pt; mso-padding-top-alt: 1.0pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;">
Wait for ACK</div>
</div>
<div class="MsoNormal" style="margin-left: 0.25in;">
The device side control logic was list below.</div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">While</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (1)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>SI32_PBSTD_A_toggle_pins(SI32_PBSTD_2, 0xC00);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// received CMD from host</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (bl_get_cmd() == 0)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">switch</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (data_buf[0])</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">case</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <span style="background: silver; mso-highlight: silver;">CMD_WRITE_FLASH</span>:</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl_write_flash();</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">break</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">case</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> CMD_READ_FLASH:</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl_read_flash();</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">break</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">case</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> CMD_ERASE_FLASH:</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl_erase_flash();</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">break</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">default</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">:</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">break</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<h2>
3.2 And the protocol functions list below:</h2>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">#define</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> FLASH_SECTOR_SIZE 0x400</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">#define</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> CMD_WRITE_FLASH<span style="mso-tab-count: 2;"> </span>0x31</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">#define</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> CMD_READ_FLASH<span style="mso-spacerun: yes;"> </span>0x11</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">#define</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> CMD_ERASE_FLASH <span style="mso-tab-count: 1;"> </span>0x43</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">#define</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> CMD_UNKNOW<span style="mso-spacerun: yes;"> </span>0xFF</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">#define</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> RES_ACK<span style="mso-spacerun: yes;"> </span>0x79</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">#define</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> RES_NACK<span style="mso-spacerun: yes;"> </span>0x1F</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt; line-height: 115%;">#define</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt; line-height: 115%;"> RES_UNKNOW<span style="mso-spacerun: yes;"> </span>0xEE</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <b>bl_send_ack</b>(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> ack)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> res = ack;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>uart_send_data(&res, 1);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoListParagraphCxSpFirst" style="line-height: normal; margin-bottom: 0in; mso-add-space: auto; mso-layout-grid-align: none;">
<br /></div>
<ul>
<li><span style="font-family: Symbol; font-size: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: "Courier New"; font-size: 10pt;">Get command from host</span></li>
</ul>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <b><span style="background: silver; mso-highlight: silver;">bl_get_cmd</span></b>(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> *ptr = data_buf;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (uart_get_data(ptr, 2) == 0)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (ptr[0] != (ptr[1] ^ 0xFF))</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl_send_ack(RES_NACK);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">return</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> -2;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">else</span></b><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl_send_ack(RES_ACK);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">return</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> 0;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">return</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> -1;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">}</span></div>
<div class="MsoListParagraphCxSpFirst" style="line-height: normal; margin-bottom: 0in; mso-add-space: auto; mso-layout-grid-align: none;">
<br /></div>
<ul>
<li><span style="font-family: Symbol; font-size: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: "Courier New"; font-size: 10pt;">Handle write flash command</span></li>
</ul>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <b>bl_write_flash</b>()</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> i;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> addr, len;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> crc;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> *ptr = data_buf;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// get address</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (uart_get_data(ptr, 5) == 0)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>crc = ptr[0] ^ ptr[1] ^ ptr[2] ^ ptr[3];</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (crc == ptr[4])</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>addr = ptr[3] | (ptr[2] << 8) | (ptr[1] << 16) | (ptr[0] << 24);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// send <u>ack</u></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl_send_ack(RES_ACK);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// get data <u>len</u></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>uart_get_data(ptr, 1);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>len = ptr[0] + 1;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// get data and <u>crc</u></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (uart_get_data(ptr, len + 1) == 0)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>crc = 0xFF;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">for</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (i = 0; i < len; i++)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>crc = crc ^ ptr[i];</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">//write flash</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (crc == ptr[len])</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> ((addr >= USER_CODE_ADDRESS) && addr < TOP_CODE_ADDRESS)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>flash_write_data(ptr, addr, len);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// send <u>ack</u></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl_send_ack(RES_ACK);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoListParagraphCxSpFirst" style="line-height: normal; margin-bottom: 0in; mso-add-space: auto; mso-layout-grid-align: none;">
<br /></div>
<ul>
<li><span style="font-family: Symbol; font-size: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: "Courier New"; font-size: 10pt;">Handle read flash command</span></li>
</ul>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <b>bl_read_flash</b>()</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> i;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> addr, len = 0;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> crc;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> *ptr = data_buf;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// get address</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (uart_get_data(ptr, 5) == 0)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>crc = ptr[0] ^ ptr[1] ^ ptr[2] ^ ptr[3];</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (crc == ptr[4])</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>addr = ptr[3] | (ptr[2] << 8) | (ptr[1] << 16) | (ptr[0] << 24);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// send <u>ack</u></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl_send_ack(RES_ACK);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// get data <u>len</u> and <u>crc</u></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">(uart_get_data(ptr, 2) == 0)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">((ptr[0] ^ 0xFF) == ptr[1])</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>len = ptr[0] + 1;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// send <u>ack</u></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl_send_ack(RES_ACK);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// send data</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">for</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;">(i =0; i < len; i++)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>ptr[i]= *(</span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> *)(addr++);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>uart_send_data(ptr,len);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoListParagraphCxSpFirst" style="line-height: normal; margin-bottom: 0in; mso-add-space: auto; mso-layout-grid-align: none;">
<br /></div>
<ul>
<li><span style="font-family: Symbol; font-size: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: "Courier New"; font-size: 10pt;">Handle erase flash command</span></li>
</ul>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">void</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> <b>bl_erase_flash</b>()</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;">{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> i;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">int</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> addr, len;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> crc;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">unsigned</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> </span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">char</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> *ptr = data_buf;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// get <u>len</u></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (uart_get_data(ptr, 1) == 0)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>len = (ptr[0] + 1) & 0xFF; </span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// maximum sector number is 256</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// get sector sequence and <u>crc</u></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (uart_get_data(ptr, len + 1) == 0)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>crc = 0xFF;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">for</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (i = 0; i < len; i++)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>crc = crc ^ ptr[i];</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// erase flash sectors</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (crc == ptr[len])</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">for</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> (i = 0; i < len; i++)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>addr = ptr[i] * FLASH_SECTOR_SIZE;</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><b><span style="color: #7f0055; font-family: "Courier New"; font-size: 10pt;">if</span></b><span style="color: black; font-family: "Courier New"; font-size: 10pt;"> ((addr >= USER_CODE_ADDRESS) && addr < TOP_CODE_ADDRESS)</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>{</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>flash_erase_page(addr);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>}</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: #3f7f5f; font-family: "Courier New"; font-size: 10pt;">// send <u>ack</u></span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none;">
<span style="color: black; font-family: "Courier New"; font-size: 10pt;"><span style="mso-spacerun: yes;"> </span>bl_send_ack(RES_ACK);</span><span style="font-family: "Courier New"; font-size: 10pt;"></span></div>
<div class="MsoNormal">
<span style="color: black; font-family: "Courier New"; font-size: 10pt; line-height: 115%;">}</span></div>
<h1>
4 Choose Python as host UART tool</h1>
<div class="MsoListParagraphCxSpFirst" style="margin-left: 0.25in; mso-add-space: auto;">
It is time to pick PC host UART tool.<span style="mso-spacerun: yes;"> </span>For easier usage purpose, we choose Python. I had tried to use Ruby serial port gem before Python. However, it is not stable. So Python become the first choice. And very lucky, I found a Python Bootloader UART source code.</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Install Python 2.6/2.7</li>
</ul>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>Go to web site <a href="http://www.python.org/">http://www.python.org/</a> to download python and install it under windows.</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Download Python Serial Port Extension</li>
</ul>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0.25in; mso-add-space: auto;">
Get it from web site <a href="http://pypi.python.org/pypi/pyserial">http://pypi.python.org/pypi/pyserial</a></div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Install Python Serial Port Extension</li>
</ul>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0.25in; mso-add-space: auto;">
Extract the package under Python install directory; execute command below to install the Serial Port Extension.</div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0.25in; mso-add-space: auto;">
$python setup.py install</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Get stm32loader.py and make you own modification.</li>
</ul>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>Get it from web site <a href="https://github.com/jsnyder/stm32loader">https://github.com/jsnyder/stm32loader</a>.</div>
<h1>
5 Build Bootloader code</h1>
<div class="MsoNormal">
We choose Silabs Precision32 UDP MCU Card as our hardware environment.</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Build Bootloader with Precision32 IDE</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Download Bootloader into SIM3U167 internal flash via Serial Wire. </li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Power up MCU card and pressing SW2, it enters Bootloader mode, DS3 and DS2 are blinking</li>
</ul>
<h1>
<span style="mso-spacerun: yes;"> </span>6 Develop User application with Bootloader</h1>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>User applications runs on Flash, but start address is not 0x00000000, we have a default value 0x1000. We need to make this modification in user application’s link file.<span style="mso-spacerun: yes;"> </span>Just change .text segment load address to 0x1000. And we also want to generate binary file in post build stage of the user application.</div>
<h1>
7 Bootloader functional test</h1>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>We were doing the test on Silabs Precision32 UDP MCU Card.</div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Connect USB cable with J10 and PC USB port, PC will found COM4 after power on.</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Copy stm32loader.py to C:\Python26 (your Python install directory).</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Copy user code binary file to C:\Python26 directory, for blinky example code, we have a sim3u1xx_Blinky.bin.</li>
</ul>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Run Python tool.</li>
</ul>
<div class="MsoListParagraphCxSpMiddle">
C:\Python26>python sim32loader.py<span style="mso-spacerun: yes;"> </span>-wv sim3u1xx_Blinky.bin</div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">sim3u1xx_Blinky.bin</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">[4, 5, 6, 7]</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">File length 3076 bytes</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1000</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1100</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1200</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1300</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1400</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1500</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1600</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1700</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1800</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1900</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1A00</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1B00</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Write 256 bytes at 0x1C00</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1000</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1100</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1200</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1300</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1400</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1500</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1600</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1700</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1800</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1900</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1A00</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1B00</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Read 256 bytes at 0x1C00</span></div>
<div class="MsoListParagraphCxSpMiddle">
<span class="MsoSubtleEmphasis">Verification OK</span></div>
<ul>
<li><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-family: "Times New Roman";"> </span></span></span>Run user application</li>
</ul>
<div class="MsoListParagraphCxSpMiddle">
Press Reset key, we can see DS3 and DS2 are alternate blinking, that means user code Blinky is running.<br />
<br />
<span style="font-size: x-large;"><strong>8. Source code</strong></span><br />
<br />
The source code can be found int github: <a href="https://github.com/MarkDing/sim3u1xx_Bootloader">https://github.com/MarkDing/sim3u1xx_Bootloader</a></div>
<div class="MsoNormal">
<br /></div>Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com11tag:blogger.com,1999:blog-6138180379582869534.post-39492783759448077812012-06-01T21:52:00.001-07:002012-06-20T00:08:19.787-07:00ARM cortex M3 instruction timing in real test.<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">movw </span></i></div>
</td>
<td style="border-left: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">32bit</span></i></div>
</td>
<td style="border-left: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">1 cycle</span></i></div>
</td>
</tr>
<tr style="mso-yfti-irow: 1;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">movt </span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">32bit</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">1 cycle</span></i></div>
</td>
</tr>
<tr style="mso-yfti-irow: 2;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">mov.w </span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">32bit</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">1 cycle</span></i></div>
</td>
</tr>
<tr style="mso-yfti-irow: 3;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">mul.w </span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">32bit</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">1 cycle</span></i></div>
</td>
</tr>
<tr style="mso-yfti-irow: 4;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">udiv</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">32bit</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">2 cycles</span></i></div>
</td>
</tr>
<tr style="mso-yfti-irow: 5;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">ldrh </span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">16bit</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">2 cycles</span></i></div>
</td>
</tr>
<tr style="mso-yfti-irow: 6;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">ldr</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">16bit</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">2 cycles</span></i></div>
</td>
</tr>
<tr style="mso-yfti-irow: 7;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">str</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">16bit</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">2 cycles</span></i></div>
</td>
</tr>
<tr style="mso-yfti-irow: 8;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">b</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">16bit</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">2 cycles</span></i></div>
</td>
</tr>
<tr style="mso-yfti-irow: 9; mso-yfti-lastrow: yes;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">cmp</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">16bit</span></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 2.05in;" valign="top" width="197"><div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">1 cycles</span></i></div>
</td>
</tr>
</tbody></table>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal">
<span style="background: none repeat scroll 0% 0% rgb(217, 217, 217);">Test method:</span></div>
<div class="MsoNormal">
<span style="background: none repeat scroll 0% 0% rgb(217, 217, 217);"> we toggle
one GPIO, and get GPIO low period as default time, and add 50 ARM instruction
in middle of the GPIO low period,
measure the GPIO low time and minus GPIO low default time, use the
result divide (1/20Mhz=50ns), and then we have 50 ARM instruction cycles.</span></div>
<h2>
<span class="Heading1Char"><span style="font-size: 14pt; line-height: 115%;">AHB=20
MHz, Project release build configuration</span></span>.</h2>
<h2 style="margin-left: .25in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
1)<span style="font: 7pt "Times New Roman";">
</span>Code running in Flash, Default
GPIO low period is 368ns.</h2>
<div class="MsoListParagraph" style="mso-list: l1 level2 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">a)<span style="font: 7pt "Times New Roman";"> </span></span><span style="font-family: "Calibri","sans-serif";">Instruction only</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l1 level3 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">i)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l1 level4 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“udiv” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>udiv</u>
r3, r2, r3");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (5448-368)
/ 50 = <span style="color: #00b050;">101, (100 cycles in theory)</span> </span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l1 level3 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">ii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l1 level4 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“movw” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>movw
r2, #41440 </u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (2888-368)
/ 50 = <span style="color: #00b050;">50, (50 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l1 level3 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l1 level3 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iv)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l1 level4 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“cmp” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>cmp
r2, r3 </u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (2868-368)
/ 50 = <span style="color: #00b050;">50, (50 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="mso-list: l1 level2 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">b)<span style="font: 7pt "Times New Roman";"> </span></span><span style="font-family: "Calibri","sans-serif";">Instruction with data access (0x20003000).</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l1 level3 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">i)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l1 level3 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">ii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l1 level3 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in;">
<span style="background: none repeat scroll 0% 0% rgb(217, 217, 217); font-family: "Calibri","sans-serif";">Generally, load-store instructions take two
cycles for the first access and one cycle for each additional access. Stores
with immediate offsets take one cycle.</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l1 level4 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“str” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>str
r2, [r</u></span><u><span style="font-family: "Calibri","sans-serif";">7</span></u><u><span style="font-family: "Calibri","sans-serif";">, #8] </span></u><span style="font-family: "Calibri","sans-serif";">");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (2961-368)
/ 50 = <span style="color: #00b050;">51, (51 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l1 level4 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(2)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“ldrh” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>ldrh
r3, [r7, #0] </u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (2966-368)
/ 50 = <span style="color: #00b050;">51, (51 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l1 level3 lfo1; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iv)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<h2 style="margin-left: .25in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
2)<span style="font: 7pt "Times New Roman";">
</span>Code running in SRAM, Default GPIO
low period is 668ns.</h2>
<div class="MsoListParagraph" style="mso-list: l0 level2 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">a)<span style="font: 7pt "Times New Roman";"> </span></span><span style="font-family: "Calibri","sans-serif";">Instruction only</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l0 level3 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">i)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l0 level4 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“udiv” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>udiv</u>
r3, r2, r3");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (5708-668)
/ 50 = <span style="color: #00b050;">100, (100 cycles in theory)</span> </span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l0 level3 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">ii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l0 level4 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“movw” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>movw
r2, #41440 </u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (5708-668)
/ 50 = <span style="color: red;">100, (50 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l0 level3 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l0 level3 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iv)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l0 level4 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“cmp” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>cmp
r2, r3 </u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (3185-668)
/ 50 = <span style="color: #00b050;">50, (50 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level2 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">b)<span style="font: 7pt "Times New Roman";"> </span></span><span style="font-family: "Calibri","sans-serif";">Instruction with data access. (0x20003000).</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l0 level3 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">i)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l0 level3 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">ii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l0 level3 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in;">
<span style="background: none repeat scroll 0% 0% rgb(217, 217, 217); font-family: "Calibri","sans-serif";">Generally, load-store instructions take two
cycles for the first access and one cycle for each additional access. Stores
with immediate offsets take one cycle.</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l0 level4 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“str” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>str
r2, [r</u></span><u><span style="font-family: "Calibri","sans-serif";">7</span></u><u><span style="font-family: "Calibri","sans-serif";">, #8] </span></u><span style="font-family: "Calibri","sans-serif";">");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (7304-668)
/ 50 = <span style="color: red;">132, (?? cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l0 level4 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(2)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“ldrh” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>ldrh
r3, [r7, #0] </u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (7005-668)
/ 50 = <span style="color: red;">126, (?? cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l0 level3 lfo4; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iv)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
The result of SRAM is not same as we expected, let’s analysis it.We
found below words from Arm Cortex M3 technical reference manual.</div>
<div class="MsoNoSpacing">
<i><span style="background: none repeat scroll 0% 0% rgb(217, 217, 217); font-family: "Calibri","sans-serif";">14.5.6. Pipelined instruction fetches</span></i></div>
<div class="MsoNoSpacing">
<i><span style="background: none repeat scroll 0% 0% rgb(217, 217, 217); font-family: "Calibri","sans-serif";">To provide a clean timing interface on the
System bus, instruction and vector fetch requests to this bus are registered.
This results in an additional cycle of latency because instructions fetched
from the System bus take two cycles. This also means that back-to-back
instruction fetches from the System bus are not possible.</span></i></div>
<div class="MsoNoSpacing">
<i><span style="background: none repeat scroll 0% 0% rgb(217, 217, 217); font-family: "Calibri","sans-serif";">Note:</span></i></div>
<div class="MsoNoSpacing">
<i><span style="background: none repeat scroll 0% 0% rgb(217, 217, 217); font-family: "Calibri","sans-serif";">Instruction fetch requests to the ICode bus are
not registered. Performance critical code must run from the ICode interface.</span></i></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<i><span style="font-family: "Calibri","sans-serif";">From above, we know that
access SRAM from system bus, the instruction fetch need two cycles. But why
some of them are match with our expectation? Let’s go through them one by one.</span></i><i><span style="font-family: "Calibri","sans-serif"; font-style: normal;"></span></i></div>
<div class="MsoNoSpacing" style="margin-left: .25in; mso-list: l3 level1 lfo2; text-indent: -.25in;">
1.<span style="font: 7pt "Times New Roman";"> </span>“udiv”, 32bit
width, 2 cycles instruction.</div>
<div class="MsoNoSpacing" style="margin-left: .25in;">
We know ARM cortex M3 has 3-stage
pipeline, fetch->decode->execute.
The maximum cycles in one stage decide whole instruction cycles. “udiv”
execute stage takes two cycles, so fetch stage increase to two cycles will not
impact the final result, so the result we got is same as we calculate.</div>
<div class="MsoNoSpacing" style="margin-left: .25in; mso-list: l3 level1 lfo2; text-indent: -.25in;">
2.<span style="font: 7pt "Times New Roman";"> </span>“movw”, 32bit
width, 1 cycle instruction.</div>
<div class="MsoNoSpacing" style="margin-left: .25in;">
Refer from above explanation, the
fetch stage become 2 cycles, so final result will be come two times then we calculate.
I have reconstructed the pipeline model, it seems reasonable.</div>
<div class="MsoNoSpacing" style="margin-left: .25in; mso-list: l3 level1 lfo2; text-indent: -.25in;">
3.<span style="font: 7pt "Times New Roman";"> </span><i><span style="font-family: "Calibri","sans-serif";">“cmp”, </span></i>16bit width, 1 cycle instruction.</div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="background: none repeat scroll 0% 0% rgb(217, 217, 217); font-size: 12pt;">All Thumb instructions are halfword aligned in
memory, so two Thumb instructions are fetched at a time. For sequential code,
an instruction fetch is performed every second cycle.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
Here are the words in spec "The PFU fetches instructions from the memory system that can supply one word each cycle. The PFU buffers up to three word fetches in its FIFO, which means that it can buffer up to three Thumb-2 instructions or six Thumb instructions. "<br />So each time it takes 2 cycles to read two Thumb instructions from SRAM into PFU. And processor fetches instruction from PFU, it keeps one clock reading one Thumb instruction, so the result makes sense.</div>
<div class="MsoNoSpacing" style="margin-left: .25in; mso-list: l3 level1 lfo2; text-indent: -.25in;">
4.<span style="font: 7pt "Times New Roman";"> </span>“str” and “ldrh”,
16bit width, 2 cycles instruction with data access. </div>
<div class="MsoNoSpacing" style="margin-left: .25in;">
Although we know when it is not Harvard
architecture, access memory cannot simulate execute code, <span style="color: red;">but I fail to calculate what is meaning about number we got</span>.<i><span style="font-family: "Calibri","sans-serif"; font-style: normal;"></span></i></div>
<h1>
AHB=80 MHz, Project release build configuration.</h1>
<h2 style="margin-left: .25in; mso-list: l7 level1 lfo5; text-indent: -.25in;">
1)<span style="font: 7pt "Times New Roman";">
</span>Code running in Flash, Default
GPIO low period is 120ns.</h2>
<div class="MsoListParagraph" style="mso-list: l5 level2 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">a)<span style="font: 7pt "Times New Roman";"> </span></span><span style="font-family: "Calibri","sans-serif";">Instruction only</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l5 level3 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">i)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l5 level4 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“udiv” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>udiv</u>
r3, r2, r3");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (1370-120)
/ 12.5 = <span style="color: #00b050;">100, (100 cycles in theory)</span> </span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l5 level3 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">ii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l5 level4 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“movw” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>movw
r2, #41440 </u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (1370-120)
/ 12.5 = <span style="color: red;">100, (50 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l5 level3 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l5 level3 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iv)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l5 level4 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“cmp” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>cmp
r2, r3 </u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (761-120)
/ 12.5 = <span style="color: #00b050;">51, (50 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="mso-list: l5 level2 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">b)<span style="font: 7pt "Times New Roman";"> </span></span><span style="font-family: "Calibri","sans-serif";">Instruction with data access (0x20003000).</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l5 level3 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">i)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l5 level3 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">ii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l5 level3 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in;">
<span style="background: none repeat scroll 0% 0% rgb(217, 217, 217); font-family: "Calibri","sans-serif";">Generally, load-store instructions take two
cycles for the first access and one cycle for each additional access. Stores
with immediate offsets take one cycle.</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l5 level4 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“str” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>str
r2, [r</u></span><u><span style="font-family: "Calibri","sans-serif";">7</span></u><u><span style="font-family: "Calibri","sans-serif";">, #8] </span></u><span style="font-family: "Calibri","sans-serif";">");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (757-120)
/ 12.5 = <span style="color: #00b050;">51, (51 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l5 level4 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(2)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“ldrh” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>ldrh
r3, [r7, #0] </u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (781-120)
/ 12.5 = <span style="color: #00b050;">53, (51 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l5 level3 lfo3; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iv)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<h1>
AHB=60 MHz, Project release build configuration.</h1>
<h2 style="margin-left: .25in; mso-list: l6 level1 lfo6; text-indent: -.25in;">
1)<span style="font: 7pt "Times New Roman";">
</span>Code running in Flash, Default
GPIO low period is 130ns.</h2>
<div class="MsoListParagraph" style="mso-list: l2 level2 lfo8; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">a)<span style="font: 7pt "Times New Roman";"> </span></span><span style="font-family: "Calibri","sans-serif";">Instruction only</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l2 level3 lfo8; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">i)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l2 level4 lfo8; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“udiv” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>udiv</u>
r3, r2, r3");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is
(1803-130) / 16.7 = <span style="color: #00b050;">100, (100 cycles in theory)</span>
</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l2 level3 lfo8; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">ii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l2 level4 lfo8; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“movw” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>movw
r2, #41440 </u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (1378-130)
/ 16.7 = <span style="color: red;">75, (50 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<h1>
AHB=50 MHz, Project release build configuration.</h1>
<h2 style="margin-left: .25in; mso-list: l4 level1 lfo7; text-indent: -.25in;">
1)<span style="font: 7pt "Times New Roman";">
</span>Code running in Flash, Default
GPIO low period is 160ns.</h2>
<div class="MsoListParagraph" style="mso-list: l8 level2 lfo9; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">a)<span style="font: 7pt "Times New Roman";"> </span></span><span style="font-family: "Calibri","sans-serif";">Instruction only</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l8 level3 lfo9; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">i)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 2 cycles</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l8 level4 lfo9; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“udiv” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>udiv</u>
r3, r2, r3");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (2153-160)
/ 20 = <span style="color: #00b050;">100, (100 cycles in theory)</span> </span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l8 level3 lfo9; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">ii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">32bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l8 level4 lfo9; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“movw” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>movw
r2, #41440 </u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (1640-160)
/ 20 = <span style="color: red;">74, (50 cycles in theory)</span></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l8 level4 lfo9; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(2)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“mul.w” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>mul.w
r3, r2, r3</u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is
(1648-160) / 20 = <span style="color: red;">74, (50 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l8 level3 lfo9; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">iii)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">16bit
width, 1 cycle</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l8 level4 lfo9; text-indent: -.25in;">
<span style="font-family: "Calibri","sans-serif";">(1)<span style="font: 7pt "Times New Roman";">
</span></span><span style="font-family: "Calibri","sans-serif";">50
“cmp” instructions</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<b><span style="font-family: "Calibri","sans-serif";">__asm</span></b><span style="font-family: "Calibri","sans-serif";">("<u>cmp
r2, r3 </u>");</span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<span style="font-family: "Calibri","sans-serif";">Total cycles is (1144-160)
/ 20 = <span style="color: #00b050;">49, (50 cycles in theory)</span></span><span style="font-family: "Calibri","sans-serif";"></span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="background: none repeat scroll 0% 0% rgb(217, 217, 217);">I have no idea about 32 bit widths 1 cycle
instruction result…</span></div>Anonymoushttp://www.blogger.com/profile/11754157520278416818noreply@blogger.com0