summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-09-10 13:36:19 +0700
committerhathach <[email protected]>2013-09-10 13:36:19 +0700
commit2d021e07287cbfaa52e61d1c7e2827667c08feab (patch)
tree25f6bc68043d1cb8375e326b2aa0676eead87627
parente823862ed1ee9f15eae339a7d8594af573b6ef2c (diff)
added support for RETARGET SWO
-rw-r--r--demos/bsp/boards/embedded_artists/board_ea4357.h1
-rw-r--r--demos/bsp/boards/printf_retarget.c18
-rw-r--r--demos/host/host_os_none/host_os_none.uvopt51
3 files changed, 40 insertions, 30 deletions
diff --git a/demos/bsp/boards/embedded_artists/board_ea4357.h b/demos/bsp/boards/embedded_artists/board_ea4357.h
index 586291406..3b0dc596c 100644
--- a/demos/bsp/boards/embedded_artists/board_ea4357.h
+++ b/demos/bsp/boards/embedded_artists/board_ea4357.h
@@ -65,6 +65,7 @@
#include "oem_base_board/pca9532.h" // LEDs
+//#define CFG_PRINTF_TARGET PRINTF_TARGET_SWO
#define CFG_PRINTF_TARGET PRINTF_TARGET_UART
#ifdef __cplusplus
diff --git a/demos/bsp/boards/printf_retarget.c b/demos/bsp/boards/printf_retarget.c
index 227db8b65..5d72c1bd8 100644
--- a/demos/bsp/boards/printf_retarget.c
+++ b/demos/bsp/boards/printf_retarget.c
@@ -107,6 +107,16 @@ int __sys_readc (void)
#elif defined __CC_ARM // keil
+#if CFG_PRINTF_TARGET == PRINTF_TARGET_UART
+ #define retarget_putc(c) board_uart_send(&c, 1);
+#elif CFG_PRINTF_TARGET == PRINTF_TARGET_SWO
+ #define retarget_putc(c) ITM_SendChar(c)
+#else
+ #error Thach, did you forget something
+#endif
+
+
+
struct __FILE {
uint32_t handle;
};
@@ -117,10 +127,10 @@ int fputc(int ch, FILE *f)
ch == '\n')
{
const uint8_t carry = '\r';
- board_uart_send(&carry, 1);
+ retarget_putc(carry);
}
- board_uart_send( (uint8_t*) &ch, 1);
+ retarget_putc(ch);
return ch;
}
@@ -131,10 +141,10 @@ void _ttywrch(int ch)
ch == '\n')
{
const uint8_t carry = '\r';
- board_uart_send(&carry, 1);
+ retarget_putc(carry);
}
- board_uart_send( (uint8_t*) &ch, 1);
+ retarget_putc(ch);
}
#endif
diff --git a/demos/host/host_os_none/host_os_none.uvopt b/demos/host/host_os_none/host_os_none.uvopt
index 6a4ffaa90..802b17479 100644
--- a/demos/host/host_os_none/host_os_none.uvopt
+++ b/demos/host/host_os_none/host_os_none.uvopt
@@ -145,12 +145,11 @@
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
- <Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>JL2CM3</Key>
- <Name>-U268003250 -O1006 -S8 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD10000000 -FC800 -FN2 -FF0LPC18xx43xx_512_BA -FS01A000000 -FL080000 -FF1LPC18xx43xx_512_BB -FS11B000000 -FL180000</Name>
+ <Name>-U268003250 -O1006 -S8 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO19 -TC72000000 -TP21 -TDS800B -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB5 -TFE0 -FO15 -FD10000000 -FC800 -FN2 -FF0LPC18xx43xx_512_BA -FS01A000000 -FL080000 -FF1LPC18xx43xx_512_BB -FS11B000000 -FL180000</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
@@ -186,7 +185,7 @@
<aLa>0</aLa>
<aPa1>0</aPa1>
<AscS4>0</AscS4>
- <aSer4>0</aSer4>
+ <aSer4>1</aSer4>
<StkLoc>0</StkLoc>
<TrcWin>0</TrcWin>
<newCpu>0</newCpu>
@@ -392,10 +391,10 @@
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
- <ColumnNumber>0</ColumnNumber>
+ <ColumnNumber>65</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>1</TopLine>
- <CurrentLine>1</CurrentLine>
+ <TopLine>10</TopLine>
+ <CurrentLine>16</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\src\main.c</PathWithFileName>
<FilenameWithoutPath>main.c</FilenameWithoutPath>
@@ -410,8 +409,8 @@
<Focus>0</Focus>
<ColumnNumber>24</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>41</TopLine>
- <CurrentLine>42</CurrentLine>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\src\cdc_serial_app.c</PathWithFileName>
<FilenameWithoutPath>cdc_serial_app.c</FilenameWithoutPath>
@@ -426,8 +425,8 @@
<Focus>0</Focus>
<ColumnNumber>20</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>119</TopLine>
- <CurrentLine>127</CurrentLine>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\src\keyboard_app.c</PathWithFileName>
<FilenameWithoutPath>keyboard_app.c</FilenameWithoutPath>
@@ -458,8 +457,8 @@
<Focus>0</Focus>
<ColumnNumber>12</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>2</TopLine>
- <CurrentLine>10</CurrentLine>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\src\rndis_app.c</PathWithFileName>
<FilenameWithoutPath>rndis_app.c</FilenameWithoutPath>
@@ -530,8 +529,8 @@
<Focus>0</Focus>
<ColumnNumber>61</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>1</TopLine>
- <CurrentLine>6</CurrentLine>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\bsp\boards\embedded_artists\oem_base_board\pca9532.c</PathWithFileName>
<FilenameWithoutPath>pca9532.c</FilenameWithoutPath>
@@ -638,7 +637,7 @@
<Group>
<GroupName>tinyusb</GroupName>
- <tvExp>0</tvExp>
+ <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -650,8 +649,8 @@
<Focus>0</Focus>
<ColumnNumber>1</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>58</TopLine>
- <CurrentLine>69</CurrentLine>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\tinyusb\tusb.c</PathWithFileName>
<FilenameWithoutPath>tusb.c</FilenameWithoutPath>
@@ -714,8 +713,8 @@
<Focus>0</Focus>
<ColumnNumber>1</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>325</TopLine>
- <CurrentLine>329</CurrentLine>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\tinyusb\host\usbh.c</PathWithFileName>
<FilenameWithoutPath>usbh.c</FilenameWithoutPath>
@@ -842,8 +841,8 @@
<Focus>0</Focus>
<ColumnNumber>0</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>206</TopLine>
- <CurrentLine>214</CurrentLine>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\tinyusb\class\cdc_host.c</PathWithFileName>
<FilenameWithoutPath>cdc_host.c</FilenameWithoutPath>
@@ -858,8 +857,8 @@
<Focus>0</Focus>
<ColumnNumber>39</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>37</TopLine>
- <CurrentLine>41</CurrentLine>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\tinyusb\class\cdc_rndis_host.c</PathWithFileName>
<FilenameWithoutPath>cdc_rndis_host.c</FilenameWithoutPath>
@@ -886,7 +885,7 @@
<Group>
<GroupName>cmsis</GroupName>
- <tvExp>1</tvExp>
+ <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -1002,8 +1001,8 @@
<Focus>0</Focus>
<ColumnNumber>5</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>145</TopLine>
- <CurrentLine>153</CurrentLine>
+ <TopLine>0</TopLine>
+ <CurrentLine>0</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s</PathWithFileName>
<FilenameWithoutPath>startup_LPC43xx.s</FilenameWithoutPath>