Skip to content

Commit 178f881

Browse files
committed
KL05Z/LPC1768 coide tmpl, KL05Z GCC warnings fixed
- LPC1768 - coide has issues with CMSIS-DAP debugging, already reported. Added this template but not enabled yet. - KL05Z export for coide - KL05Z - supressed warnings in HAL
1 parent ef94bdf commit 178f881

File tree

10 files changed

+184
-10
lines changed

10 files changed

+184
-10
lines changed

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KL05Z/analogin_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static const PinMap PinMap_ADC[] = {
4141

4242
void analogin_init(analogin_t *obj, PinName pin) {
4343
obj->adc = (ADCName)pinmap_peripheral(pin, PinMap_ADC);
44-
if (obj->adc == (uint32_t)NC) {
44+
if (obj->adc == (ADCName)NC) {
4545
error("ADC pin mapping failed");
4646
}
4747

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KL05Z/analogout_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static const PinMap PinMap_DAC[] = {
2828

2929
void analogout_init(dac_t *obj, PinName pin) {
3030
obj->dac = (DACName)pinmap_peripheral(pin, PinMap_DAC);
31-
if (obj->dac == (uint32_t)NC) {
31+
if (obj->dac == (DACName)NC) {
3232
error("DAC pin mapping failed");
3333
}
3434

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KL05Z/gpio_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ uint32_t gpio_set(PinName pin) {
2222
}
2323

2424
void gpio_init(gpio_t *obj, PinName pin, PinDirection direction) {
25-
if (pin == (uint32_t)NC) {
25+
if (pin == (PinName)NC) {
2626
return;
2727
}
2828

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KL05Z/i2c_api.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ void i2c_frequency(i2c_t *obj, int hz) {
197197
for (i = 1; i < 5; i*=2) {
198198
for (j = 0; j < 0x40; j++) {
199199
ref = PCLK / (i*ICR[j]);
200-
error = (ref > hz) ? ref - hz : hz - ref;
200+
if (ref > (uint32_t)hz)
201+
continue;
202+
error = hz - ref;
201203
if (error < p_error) {
202204
icr = j;
203205
mult = i/2;
@@ -371,7 +373,7 @@ int i2c_slave_read(i2c_t *obj, char *data, int length) {
371373
}
372374

373375
int i2c_slave_write(i2c_t *obj, const char *data, int length) {
374-
uint32_t i, count = 0;
376+
int32_t i, count = 0;
375377

376378
// set tx mode
377379
obj->i2c->C1 |= I2C_C1_TX_MASK;

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KL05Z/pinmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "error.h"
1818

1919
void pin_function(PinName pin, int function) {
20-
if (pin == (uint32_t)NC) {
20+
if (pin == (PinName)NC) {
2121
return;
2222
}
2323

@@ -32,7 +32,7 @@ void pin_function(PinName pin, int function) {
3232
}
3333

3434
void pin_mode(PinName pin, PinMode mode) {
35-
if (pin == (uint32_t)NC) {
35+
if (pin == (PinName)NC) {
3636
return;
3737
}
3838

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KL05Z/pwmout_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static const PinMap PinMap_PWM[] = {
4242
void pwmout_init(pwmout_t* obj, PinName pin) {
4343
// determine the channel
4444
PWMName pwm = (PWMName)pinmap_peripheral(pin, PinMap_PWM);
45-
if (pwm == (uint32_t)NC) {
45+
if (pwm == (PWMName)NC) {
4646
error("PwmOut pin mapping failed");
4747
}
4848

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KL05Z/spi_api.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ void spi_frequency(spi_t *obj, int hz) {
123123
divisor = 2;
124124
for (spr = 0; spr <= 8; spr++) {
125125
ref = PCLK / (prescaler*divisor);
126-
error = (ref > hz) ? ref - hz : hz - ref;
126+
if (ref > (uint32_t)hz)
127+
continue;
128+
error = hz - ref;
127129
if (error < p_error) {
128130
ref_spr = spr;
129131
ref_prescaler = prescaler - 1;

workspace_tools/export/coide.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CoIDE(Exporter):
2626
'cpp_sources':'1',
2727
's_sources':'1'
2828
}
29-
TARGETS = ['KL25Z']
29+
TARGETS = ['KL25Z','KL05Z']
3030
TOOLCHAIN = 'GCC_ARM'
3131

3232
def generate(self):
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<Project version="2G - 1.7.5" name="{{name}}">
3+
<Target name="{{name}}" isCurrent="1">
4+
<Device manufacturerId="4" manufacturerName="Freescale" chipId="49" chipName="MKL05Z32VFM4" boardId="" boardName=""/>
5+
<BuildOption>
6+
<Compile>
7+
<Option name="OptimizationLevel" value="4"/>
8+
<Option name="UseFPU" value="0"/>
9+
<Option name="UserEditCompiler" value="-fno-common; -fmessage-length=0; -Wall; -fno-strict-aliasing; -fno-rtti; -fno-exceptions; -ffunction-sections; -fdata-sections; -std=gnu++98"/>
10+
<Includepaths>
11+
{% for path in include_paths %} <Includepath path="{{path}}"/> {% endfor %}
12+
</Includepaths>
13+
<DefinedSymbols>
14+
{% for s in symbols %} <Define name="{{s}}"/> {% endfor %}
15+
</DefinedSymbols>
16+
</Compile>
17+
<Link useDefault="0">
18+
<Option name="DiscardUnusedSection" value="0"/>
19+
<Option name="UserEditLinkder" value=""/>
20+
<Option name="UseMemoryLayout" value="0"/>
21+
<Option name="LTO" value="0"/>
22+
<Option name="IsNewStartupCode" value="1"/>
23+
<Option name="Library" value="Not use C Library"/>
24+
<Option name="nostartfiles" value="0"/>
25+
<Option name="UserEditLinker" value="--specs=nano.specs; -u _printf_float; -u _scanf_float; {% for file in object_files %}
26+
${project.path}/{{file}}; {% endfor %} {% for p in library_paths %}-L${project.path}/{{p}}; {% endfor %}"/>
27+
<LinkedLibraries>
28+
{% for lib in libraries %}
29+
<Libset dir="" libs="{{lib}}"/>
30+
{% endfor %}
31+
<Libset dir="" libs="stdc++"/>
32+
<Libset dir="" libs="supc++"/>
33+
<Libset dir="" libs="m"/>
34+
<Libset dir="" libs="gcc"/>
35+
<Libset dir="" libs="c"/>
36+
<Libset dir="" libs="nosys"/>
37+
</LinkedLibraries>
38+
<MemoryAreas debugInFlashNotRAM="1">
39+
<Memory name="IROM1" type="ReadOnly" size="0x00020000" startValue="0x00000000"/>
40+
<Memory name="IRAM1" type="ReadWrite" size="0x00001000" startValue="0x1FFFF000"/>
41+
<Memory name="IROM2" type="ReadOnly" size="" startValue=""/>
42+
<Memory name="IRAM2" type="ReadWrite" size="" startValue=""/>
43+
</MemoryAreas>
44+
<LocateLinkFile path="{{scatter_file}}" type="0"/>
45+
</Link>
46+
<Output>
47+
<Option name="OutputFileType" value="0"/>
48+
<Option name="Path" value="./"/>
49+
<Option name="Name" value="{{name}}"/>
50+
<Option name="HEX" value="1"/>
51+
<Option name="BIN" value="1"/>
52+
</Output>
53+
<User>
54+
<UserRun name="Run#1" type="Before" checked="0" value=""/>
55+
<UserRun name="Run#1" type="After" checked="0" value=""/>
56+
</User>
57+
</BuildOption>
58+
<DebugOption>
59+
<Option name="org.coocox.codebugger.gdbjtag.core.adapter" value="CMSIS-DAP"/>
60+
<Option name="org.coocox.codebugger.gdbjtag.core.debugMode" value="SWD"/>
61+
<Option name="org.coocox.codebugger.gdbjtag.core.clockDiv" value="1M"/>
62+
<Option name="org.coocox.codebugger.gdbjtag.corerunToMain" value="1"/>
63+
<Option name="org.coocox.codebugger.gdbjtag.core.jlinkgdbserver" value=""/>
64+
<Option name="org.coocox.codebugger.gdbjtag.core.userDefineGDBScript" value=""/>
65+
<Option name="org.coocox.codebugger.gdbjtag.core.targetEndianess" value="0"/>
66+
<Option name="org.coocox.codebugger.gdbjtag.core.jlinkResetMode" value="Type 0: Normal"/>
67+
<Option name="org.coocox.codebugger.gdbjtag.core.resetMode" value="SYSRESETREQ"/>
68+
<Option name="org.coocox.codebugger.gdbjtag.core.ifSemihost" value="0"/>
69+
<Option name="org.coocox.codebugger.gdbjtag.core.ifCacheRom" value="1"/>
70+
<Option name="org.coocox.codebugger.gdbjtag.core.ipAddress" value="127.0.0.1"/>
71+
<Option name="org.coocox.codebugger.gdbjtag.core.portNumber" value="2009"/>
72+
<Option name="org.coocox.codebugger.gdbjtag.core.autoDownload" value="1"/>
73+
<Option name="org.coocox.codebugger.gdbjtag.core.verify" value="1"/>
74+
<Option name="org.coocox.codebugger.gdbjtag.core.downloadFuction" value="Erase Effected"/>
75+
<Option name="org.coocox.codebugger.gdbjtag.core.defaultAlgorithm" value="KLxx_32_PRG_NO_CFG.elf"/>
76+
</DebugOption>
77+
<ExcludeFile/>
78+
</Target>
79+
<Components path="./"/>
80+
<Files>
81+
{% for file in source_files %}
82+
<File name="{{file.name}}" path="{{file.path}}" type="{{file.type}}"/>
83+
{% endfor %}
84+
</Files>
85+
</Project>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<Project version="2G - 1.7.5" name="{{name}}">
3+
<Target name="{{name}}" isCurrent="1">
4+
<Device manufacturerId="7" manufacturerName="NXP" chipId="165" chipName="LPC1768" boardId="" boardName=""/>
5+
<BuildOption>
6+
<Compile>
7+
<Option name="OptimizationLevel" value="4"/>
8+
<Option name="UseFPU" value="0"/>
9+
<Option name="UserEditCompiler" value="-fno-common; -fmessage-length=0; -Wall; -fno-strict-aliasing; -fno-rtti; -fno-exceptions; -ffunction-sections; -fdata-sections; -std=gnu++98"/>
10+
<Includepaths>
11+
{% for path in include_paths %} <Includepath path="{{path}}"/> {% endfor %}
12+
</Includepaths>
13+
<DefinedSymbols>
14+
{% for s in symbols %} <Define name="{{s}}"/> {% endfor %}
15+
</DefinedSymbols>
16+
</Compile>
17+
<Link useDefault="0">
18+
<Option name="DiscardUnusedSection" value="0"/>
19+
<Option name="UserEditLinkder" value=""/>
20+
<Option name="UseMemoryLayout" value="0"/>
21+
<Option name="LTO" value="0"/>
22+
<Option name="IsNewStartupCode" value="1"/>
23+
<Option name="Library" value="Not use C Library"/>
24+
<Option name="nostartfiles" value="0"/>
25+
<Option name="UserEditLinker" value="--specs=nano.specs; -u _printf_float; -u _scanf_float; {% for file in object_files %}
26+
${project.path}/{{file}}; {% endfor %}; {% for p in library_paths %}-L{{p}}; {% endfor %}"/>
27+
<LinkedLibraries>
28+
{% for lib in libraries %}
29+
<Libset dir="" libs="{{lib}}"/>
30+
{% endfor %}
31+
<Libset dir="" libs="stdc++"/>
32+
<Libset dir="" libs="supc++"/>
33+
<Libset dir="" libs="m"/>
34+
<Libset dir="" libs="gcc"/>
35+
<Libset dir="" libs="c"/>
36+
<Libset dir="" libs="nosys"/>
37+
</LinkedLibraries>
38+
<MemoryAreas debugInFlashNotRAM="1">
39+
<Memory name="IROM1" type="ReadOnly" size="0x00080000" startValue="0x00000000"/>
40+
<Memory name="IRAM1" type="ReadWrite" size="0x00008000" startValue="0x10000000"/>
41+
<Memory name="IROM2" type="ReadOnly" size="" startValue=""/>
42+
<Memory name="IRAM2" type="ReadWrite" size="0x00008000" startValue="0x2007C000"/>
43+
</MemoryAreas>
44+
<LocateLinkFile path="{{scatter_file}}" type="0"/>
45+
</Link>
46+
<Output>
47+
<Option name="OutputFileType" value="0"/>
48+
<Option name="Path" value="./"/>
49+
<Option name="Name" value="{{name}}"/>
50+
<Option name="HEX" value="1"/>
51+
<Option name="BIN" value="1"/>
52+
</Output>
53+
<User>
54+
<UserRun name="Run#1" type="Before" checked="0" value=""/>
55+
<UserRun name="Run#1" type="After" checked="0" value=""/>
56+
</User>
57+
</BuildOption>
58+
<DebugOption>
59+
<Option name="org.coocox.codebugger.gdbjtag.core.adapter" value="CMSIS-DAP"/>
60+
<Option name="org.coocox.codebugger.gdbjtag.core.debugMode" value="SWD"/>
61+
<Option name="org.coocox.codebugger.gdbjtag.core.clockDiv" value="1M"/>
62+
<Option name="org.coocox.codebugger.gdbjtag.corerunToMain" value="1"/>
63+
<Option name="org.coocox.codebugger.gdbjtag.core.jlinkgdbserver" value=""/>
64+
<Option name="org.coocox.codebugger.gdbjtag.core.userDefineGDBScript" value=""/>
65+
<Option name="org.coocox.codebugger.gdbjtag.core.targetEndianess" value="0"/>
66+
<Option name="org.coocox.codebugger.gdbjtag.core.jlinkResetMode" value="Type 0: Normal"/>
67+
<Option name="org.coocox.codebugger.gdbjtag.core.resetMode" value="SYSRESETREQ"/>
68+
<Option name="org.coocox.codebugger.gdbjtag.core.ifSemihost" value="0"/>
69+
<Option name="org.coocox.codebugger.gdbjtag.core.ifCacheRom" value="1"/>
70+
<Option name="org.coocox.codebugger.gdbjtag.core.ipAddress" value="127.0.0.1"/>
71+
<Option name="org.coocox.codebugger.gdbjtag.core.portNumber" value="2009"/>
72+
<Option name="org.coocox.codebugger.gdbjtag.core.autoDownload" value="1"/>
73+
<Option name="org.coocox.codebugger.gdbjtag.core.verify" value="1"/>
74+
<Option name="org.coocox.codebugger.gdbjtag.core.downloadFuction" value="Erase Effected"/>
75+
<Option name="org.coocox.codebugger.gdbjtag.core.defaultAlgorithm" value="LPC17xx_512.elf"/>
76+
</DebugOption>
77+
<ExcludeFile/>
78+
</Target>
79+
<Components path="./"/>
80+
<Files>
81+
{% for file in source_files %}
82+
<File name="{{file.name}}" path="{{file.path}}" type="{{file.type}}"/>
83+
{% endfor %}
84+
</Files>
85+
</Project>

0 commit comments

Comments
 (0)