Skip to content

Commit

Permalink
Merge pull request #213 from Infineon/develop for 1.7.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jaenrig-ifx committed Oct 17, 2022
2 parents 4379305 + 76426e2 commit 2c0fc3c
Show file tree
Hide file tree
Showing 59 changed files with 20,397 additions and 555 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/compile-platform-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,26 @@ jobs:
multiSerial: true
dma: true
alarmRtc: true
- fqbn: Infineon:arm:XMC1400_Arduino_Kit
i2s: false
dieTemp: true
heapMem: true
sleep1100: true
sleep4700 : false
stackMem: false
multiSerial: false
dma: false
alarmRtc: false
- fqbn: Infineon:arm:XMC4200_Platform2GO
i2s: false
dieTemp: false
heapMem: false
sleep1100: false
sleep4700 : false
stackMem: true
multiSerial: false
dma: false
alarmRtc: true

# Make board type-specific customizations to the matrix jobs
include:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This repository integrates [Infineon's](https://www.infineon.com/) XMC microcont
* [XMC1300 Sense2GoL](https://www.infineon.com/cms/de/product/evaluation-boards/demo-sense2gol/)
* [XMC4400 Platform 2Go](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc_plt2go_xmc4400//)
* [XMC4700 Relax Kit](https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc47_relax_v1/)
* [DEMO Radar BB XMC4700](https://www.infineon.com/cms/en/product/evaluation-boards/demo-sense2gol-pulse/)
* [XMC4700 Radar Baseboard](https://www.infineon.com/cms/en/product/evaluation-boards/demo-sense2gol-pulse/)


## Additional Information
Expand All @@ -37,7 +37,7 @@ Please visit also the Wiki for additional information, e.g. datasheets, pin out
* Page for [XMC1300 Sense2GoL](https://github.com/Infineon/XMC-for-Arduino/wiki/XMC1300-Sense2GoL)
* Page for [XMC4400 Platform 2Go](https://github.com/Infineon/XMC-for-Arduino/wiki/XMC4400-Platform2Go)
* Page for [XMC4700 Relax Kit](https://github.com/Infineon/XMC-for-Arduino/wiki/XMC4700-Relax-Kit)
* Page for [DEMO Radar BB XMC4700](https://github.com/Infineon/XMC-for-Arduino/wiki/DEMO-Radar-BB-XMC4700)
* Page for [XMC4700 Radar Baseboard](https://github.com/Infineon/XMC-for-Arduino/wiki/DEMO-Radar-BB-XMC4700)

Additionally, please consult the [releases](https://github.com/Infineon/XMC-for-Arduino/releases) for information about the changes and new versions.

Expand Down
85 changes: 84 additions & 1 deletion boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,89 @@ XMC1300_Sense2GoL.menu.LIB.DSP.library.selected=-DARM_LIB_CMSIS_DSP
#XMC1400_Boot_Kit.menu.LIB.DSPNN=ARM DSP / ARM NN Framework
#XMC1400_Boot_Kit.menu.LIB.DSPNN.library.selected=-DARM_LIB_CMSIS_DSP -DARM_LIB_CMSIS_NN

####################################################
XMC1400_Arduino_Kit.name=XMC1400 Kit for Arduino
XMC1400_Arduino_Kit.upload.tool=xmcprog
XMC1400_Arduino_Kit.upload.speed=115200
XMC1400_Arduino_Kit.upload.resetmethod=ck
XMC1400_Arduino_Kit.upload.maximum_size=204800
XMC1400_Arduino_Kit.upload.wait_for_upload_port=true

XMC1400_Arduino_Kit.communication=usb
XMC1400_Arduino_Kit.protocol=dragon_isp
XMC1400_Arduino_Kit.program.protocol=dragon_isp
XMC1400_Arduino_Kit.program.tool=xmcprog
XMC1400_Arduino_Kit.program.extra_params=-Pusb

XMC1400_Arduino_Kit.serial.disableDTR=true
XMC1400_Arduino_Kit.serial.disableRTS=true

XMC1400_Arduino_Kit.build.mcu=cortex-m0
XMC1400_Arduino_Kit.build.f_cpu=48000000L
XMC1400_Arduino_Kit.build.board=ARM_XMC
XMC1400_Arduino_Kit.build.board.version=1402
XMC1400_Arduino_Kit.build.board.type=T038x0200
XMC1400_Arduino_Kit.build.board.v=0200
XMC1400_Arduino_Kit.build.core=./
XMC1400_Arduino_Kit.build.variant=XMC1400
XMC1400_Arduino_Kit.build.board_variant=XMC1400_Arduino_Kit
XMC1400_Arduino_Kit.build.flash_size=200K
XMC1400_Arduino_Kit.build.flash_ld=linker_script_200k.ld
XMC1400_Arduino_Kit.build.extra_flags=-DARM_MATH_CM0 -DXMC1_SERIES

XMC1400_Arduino_Kit.menu.UART.debug=PC
XMC1400_Arduino_Kit.menu.UART.debug.uart.selected=-DSERIAL_HOSTPC
XMC1400_Arduino_Kit.menu.UART.onBoard=On Board
XMC1400_Arduino_Kit.menu.UART.onBoard.uart.selected=-DSERIAL_ONBOARD

XMC1400_Arduino_Kit.menu.LIB.NONE=None
XMC1400_Arduino_Kit.menu.LIB.NONE.library.selected=
XMC1400_Arduino_Kit.menu.LIB.NN=ARM NN Framework
XMC1400_Arduino_Kit.menu.LIB.NN.library.selected=-DARM_LIB_CMSIS_NN
XMC1400_Arduino_Kit.menu.LIB.DSP=ARM DSP
XMC1400_Arduino_Kit.menu.LIB.DSP.library.selected=-DARM_LIB_CMSIS_DSP
XMC1400_Arduino_Kit.menu.LIB.DSPNN=ARM DSP / ARM NN Framework
XMC1400_Arduino_Kit.menu.LIB.DSPNN.library.selected=-DARM_LIB_CMSIS_DSP -DARM_LIB_CMSIS_NN

####################################################
XMC4200_Platform2GO.name=XMC4200 Platform 2GO
XMC4200_Platform2GO.upload.tool=xmcprog
XMC4200_Platform2GO.upload.speed=115200
XMC4200_Platform2GO.upload.resetmethod=ck
XMC4200_Platform2GO.upload.maximum_size=262144
XMC4200_Platform2GO.upload.wait_for_upload_port=true

XMC4200_Platform2GO.communication=usb
XMC4200_Platform2GO.protocol=dragon_isp
XMC4200_Platform2GO.program.protocol=dragon_isp
XMC4200_Platform2GO.program.tool=xmcprog
XMC4200_Platform2GO.program.extra_params=-Pusb

XMC4200_Platform2GO.serial.disableDTR=true
XMC4200_Platform2GO.serial.disableRTS=true

XMC4200_Platform2GO.build.mcu=cortex-m4
XMC4200_Platform2GO.build.f_cpu=80000000L
XMC4200_Platform2GO.build.board=ARM_XMC
XMC4200_Platform2GO.build.board.version=4200
XMC4200_Platform2GO.build.board.type=F64x256
XMC4200_Platform2GO.build.board.v=256
XMC4200_Platform2GO.build.core=./
XMC4200_Platform2GO.build.variant=XMC4200
XMC4200_Platform2GO.build.board_variant=XMC4200_Platform2GO
XMC4200_Platform2GO.build.flash_size=256K
XMC4200_Platform2GO.build.flash_ld=linker_script.ld
XMC4200_Platform2GO.build.extra_flags=-DARM_MATH_CM4 -DARM_MATH_DSP -DINTERRUPT_USE_ERU
#-DUSB0

XMC4200_Platform2GO.menu.LIB.NONE=None
XMC4200_Platform2GO.menu.LIB.NONE.library.selected=
XMC4200_Platform2GO.menu.LIB.DSPNN=ARM DSP / ARM NN Framework
XMC4200_Platform2GO.menu.LIB.DSPNN.library.selected=-DARM_LIB_CMSIS_DSP -DARM_LIB_CMSIS_NN
XMC4200_Platform2GO.menu.LIB.NN=ARM NN Framework
XMC4200_Platform2GO.menu.LIB.NN.library.selected=-DARM_LIB_CMSIS_NN
XMC4200_Platform2GO.menu.LIB.DSP=ARM DSP
XMC4200_Platform2GO.menu.LIB.DSP.library.selected=-DARM_LIB_CMSIS_DSP

####################################################
XMC4400_Platform2GO.name=XMC4400 Platform 2GO
Expand Down Expand Up @@ -308,7 +391,7 @@ XMC4400_Platform2GO.menu.LIB.DSP=ARM DSP
XMC4400_Platform2GO.menu.LIB.DSP.library.selected=-DARM_LIB_CMSIS_DSP

####################################################
XMC4700_Radar_Baseboard.name=DEMO Radar BB XMC4700
XMC4700_Radar_Baseboard.name=XMC4700 Radar Baseboard
XMC4700_Radar_Baseboard.upload.tool=xmcprog
XMC4700_Radar_Baseboard.upload.speed=115200
XMC4700_Radar_Baseboard.upload.resetmethod=ck
Expand Down
5 changes: 3 additions & 2 deletions cores/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ int main(void)
*/
wiring_time_init();
wiring_analog_init();
// Initialize the reset pin for the XMC1100 Boot Kit series
#ifdef XMC1100_Boot_Kit
// Initialize the reset pin for the XMC1100 Boot Kit series and XMC1400 Kit for Arduino as they are based on Arduino form-factor
// Hence, a dedicated reset pin is required.
#ifdef HAS_GPIO_RESET
reset_init();
#endif

Expand Down
36 changes: 31 additions & 5 deletions cores/WInterrupts.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,24 @@ void ERU0_3_IRQHandler(void)
}
}

#if defined(XMC4200_Platform2GO)
void ERU0_0_IRQHandler(void)
{
if (interrupt_1_cb)
{
interrupt_1_cb();
}
}
#else
void ERU1_0_IRQHandler(void)
{
if (interrupt_1_cb)
{
interrupt_1_cb();
}
}
#endif

#else
void CCU40_0_IRQHandler(void)
{
Expand Down Expand Up @@ -109,10 +120,16 @@ void attachInterrupt(uint32_t interrupt_num, interrupt_cb_t callback, uint32_t m
}
else if (pin_irq.irq_num == 1)
{
NVIC_SetPriority(ERU1_0_IRQn, 3);
#if defined(XMC4200_Platform2GO)
NVIC_SetPriority(ERU0_0_IRQn, 3);
interrupt_1_cb = callback;
NVIC_EnableIRQ(ERU0_0_IRQn);
#else
NVIC_SetPriority(ERU1_0_IRQn, 3);
interrupt_1_cb = callback;
NVIC_EnableIRQ(ERU1_0_IRQn);
}
#endif
}
#else
XMC_CCU4_SLICE_EVENT_CONFIG_t event_config = {0};

Expand Down Expand Up @@ -140,7 +157,7 @@ void attachInterrupt(uint32_t interrupt_num, interrupt_cb_t callback, uint32_t m

if (pin_irq.irq_num == 0)
{
#if defined(XMC1100_Boot_Kit)
#if defined(XMC1100_Boot_Kit) || defined(XMC1400_Arduino_Kit)
/* P1_4 external interrupt goes through USIC to CCU4 */
XMC_USIC_CH_Enable(XMC_USIC0_CH0);
XMC_USIC_CH_SetInputSource(XMC_USIC0_CH0, XMC_USIC_CH_INPUT_DX5, USIC0_C0_DX5_P1_4);
Expand All @@ -159,9 +176,14 @@ void attachInterrupt(uint32_t interrupt_num, interrupt_cb_t callback, uint32_t m
else if (pin_irq.irq_num == 1)
{
#if defined(XMC1300_Boot_Kit)
/* P0_13 external interrupt goes through USIC to CCU4 */
/* P0_13 external interrupt goes through USIC to CCU4 */
XMC_USIC_CH_Enable(XMC_USIC0_CH0);
XMC_USIC_CH_SetInputSource(XMC_USIC0_CH0, XMC_USIC_CH_INPUT_DX2, USIC0_C0_DX2_P0_13);
#endif
#if defined(XMC1400_Arduino_Kit)
/* P1_1 external interrupt goes through USIC to CCU4 */
XMC_USIC_CH_Enable(XMC_USIC0_CH1);
XMC_USIC_CH_SetInputSource(XMC_USIC0_CH1, XMC_USIC_CH_INPUT_DX2, USIC0_C1_DX2_P1_1);
#endif
XMC_CCU4_SLICE_EnableMultipleEvents(pin_irq.slice, XMC_CCU4_SLICE_MULTI_IRQ_ID_EVENT1);
XMC_CCU4_SLICE_SetInterruptNode(pin_irq.slice, XMC_CCU4_SLICE_IRQ_ID_EVENT1, 1);
Expand Down Expand Up @@ -190,7 +212,11 @@ void detachInterrupt(uint32_t interrupt_num)
break;

case 1:
NVIC_DisableIRQ(ERU1_0_IRQn);
#if defined(XMC4200_Platform2GO)
NVIC_DisableIRQ(ERU0_0_IRQn);
#else
NVIC_DisableIRQ(ERU1_0_IRQn);
#endif
break;
#else
switch (interrupt_num)
Expand Down
4 changes: 2 additions & 2 deletions cores/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
* WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <reset.h>
#ifdef XMC1100_Boot_Kit
#include <Arduino.h>
#ifdef HAS_GPIO_RESET
#include <xmc_eru.h>
#include <xmc_scu.h>

Expand Down
2 changes: 0 additions & 2 deletions cores/reset.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
#ifndef Reset_h
#define Reset_h

#include <Arduino.h>

//****************************************************************************
// @External Prototypes
//****************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions cores/wiring_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ if( ( resource = scan_map_table( mapping_pin_PWM4, pin ) ) >= 0 )
( XMC_GPIO_MODE_OUTPUT_PUSH_PULL | pwm4->port_mode ) );
XMC_CCU4_SLICE_StartTimer( pwm4->slice );
}
#ifdef CCU8V2
#if defined(CCU8V2) || defined(CCU8V1)
else
if( ( resource = scan_map_table( mapping_pin_PWM8, pin ) ) >= 0 )
{
Expand Down Expand Up @@ -391,7 +391,7 @@ if( frequency < PCLK )
}
ret = 0;
}
#ifdef CCU8V2
#if defined (CCU8V2) || defined (CCU8V1)
else
if ( ( resource = scan_map_table( mapping_pin_PWM8, pin ) ) >= 0 )
{
Expand Down
31 changes: 31 additions & 0 deletions cores/wiring_time.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,37 @@ extern "C" {
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop");}

#elif ((UC_FAMILY == XMC4) && (F_CPU == 80000000U))
// 80 NOPS
#define NOPS_FOR_USEC() { asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
asm volatile("nop"); asm volatile("nop");}

#elif ((UC_FAMILY == XMC1) && (F_CPU == 32000000U))
// 16 NOPS
#define NOPS_FOR_USEC() { asm volatile("nop"); asm volatile("nop"); asm volatile("nop");\
Expand Down
2 changes: 1 addition & 1 deletion keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ LED6 LITERAL1
BUTTON1 LITERAL1
BUTTON2 LITERAL1

# Radar Baseboard XMC4700 only
# XMC4700 Radar Baseboard only
LED_RED LITERAL1
LED_BLUE LITERAL1
LED_GREEN LITERAL1
18 changes: 9 additions & 9 deletions libraries/BGT24LTR11-Pulsed-Doppler-Radar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Two Arduino sketch examples are provided in the current library release. These e
This example sketch runs the Pulsed Doppler firmware and uses the on-board LED to indicate detection of motion and direction of motion.

**Hardware required:**
Radar Baseboard XMC4700 and BGT24LTR11 Shield
XMC4700 Radar Baseboard and BGT24LTR11 Shield

**Steps:**
1. In Arduino IDE, navigate to **File** --> **Examples** --> **IFXRadarPulsedDoppler** --> **Radar_Pulsed_Doppler_LED**
Expand All @@ -108,11 +108,11 @@ Radar Baseboard XMC4700 and BGT24LTR11 Shield

![Done Compiling](https://raw.githubusercontent.com/infineon/assets/master/Pictures/rbb_done_compiling.png)

4. Attach the BGT24LTR11 Shield to the Radar Baseboard XMC4700 via the SAMTEC connectors.
4. Attach the BGT24LTR11 Shield to the XMC4700 Radar Baseboard via the SAMTEC connectors.

![Connecting Boards](https://raw.githubusercontent.com/infineon/assets/master/Pictures/rbb_connecting_boards.png)

5. Connect the Radar Baseboard XMC4700 to the PC via a USB cable onto the **Debug** USB port.
5. Connect the XMC4700 Radar Baseboard to the PC via a USB cable onto the **Debug** USB port.

![Debug Port](https://raw.githubusercontent.com/infineon/assets/master/Pictures/rbb_debug_port.png)

Expand All @@ -139,7 +139,7 @@ This example sketch runs the Pulsed Doppler firmware and projects the results of
and at the same time uses an external RGB LED to indicate motion and direction of motion.

**Hardware required:**
1) Radar Baseboard XMC4700 and BGT24LTR11 Shield
1) XMC4700 Radar Baseboard and BGT24LTR11 Shield
2) Annikken Andee U Shield (https://www.annikken.com/andee-u)
3) RGB LED Lighting Shield with XMC1202 (https://www.infineon.com/cms/en/product/evaluation-boards/kit_led_xmc1202_as_01/)

Expand All @@ -158,25 +158,25 @@ and at the same time uses an external RGB LED to indicate motion and direction o

![Done Compiling](https://raw.githubusercontent.com/infineon/assets/master/Pictures/rbb_done_compiling.png)

4. Attach the BGT24LTR11 Shield to the Radar Baseboard XMC4700 via the SAMTEC connectors.
4. Attach the BGT24LTR11 Shield to the XMC4700 Radar Baseboardvia the SAMTEC connectors.

![Connecting Boards](https://raw.githubusercontent.com/infineon/assets/master/Pictures/rbb_connecting_boards.png)

5. Stack the RGB LED Lighting Shield with XMC1202 onto the Radar Baseboard XMC4700 via the Arduino stack headers.
5. Stack the RGB LED Lighting Shield with XMC1202 onto the XMC4700 Radar Baseboard via the Arduino stack headers.
Also connect an RGB LED and a 24 VDC power adapter to the RGB LED Lighting Shield. **Do not turn the power on yet!**
For more information on setting up of the RGB LED Lighting Shield, please refer to [Infineon RGB LED Lighting Shield with XMC1202 for Arduino - User Manual](https://www.infineon.com/dgdl/Infineon-Board_Manual_-_XMC1202_-_RGB_LED_Lighting_Shield_with_XMC1202_for_Arduino_-_v1_0-UM-v01_00-EN.pdf?fileId=5546d46249be182c0149ccca3860734d).

![RGB LED Shield Setup](https://raw.githubusercontent.com/infineon/assets/master/Pictures/rbb_RGB_LED_Shield_Setup.png)

6. Stack the Annikken Andee U shield onto the setup. Notice that there are several jumper wires on the Annikken Andee U board.
This is due to the hardware modifications required on the Radar Baseboard regarding the ISCP header as mentioned in [the XMC4700 Radar Baseboard Wiki](https://github.com/Infineon/XMC-for-Arduino/wiki/Radar-Baseboard-XMC4700).
This is due to the hardware modifications required on the Radar Baseboard regarding the ISCP header as mentioned in [the XMC4700 Radar BaseboardWiki](https://github.com/Infineon/XMC-for-Arduino/wiki/Radar-Baseboard-XMC4700).
The second diagram below illustrates the required connections.

![Annikken Andee U](https://raw.githubusercontent.com/infineon/assets/master/Pictures/rbb_Annikken_Andee_U.png)

![Andee Jumpers](https://raw.githubusercontent.com/infineon/assets/master/Pictures/rbb_Andee_Jumpers.png)

7. Turn on the 24 VDC power supply to the RGB LED Lighting Shield and connect the Radar Baseboard XMC4700 to the PC via a USB cable onto the **Debug** USB port.
7. Turn on the 24 VDC power supply to the RGB LED Lighting Shield and connect the XMC4700 Radar Baseboard to the PC via a USB cable onto the **Debug** USB port.

![Debug Port](https://raw.githubusercontent.com/infineon/assets/master/Pictures/rbb_debug_port.png)

Expand All @@ -200,7 +200,7 @@ The RGB LED should turn on with white light, while the on-board LED will cycle b

![Andee GUI](https://raw.githubusercontent.com/infineon/assets/master/Pictures/rbb_Andee-GUI.png)

In case this does not happen, disconnect from the app, press the reset button on the Radar Baseboard XMC4700 and retry the connection.
In case this does not happen, disconnect from the app, press the reset button on the XMC4700 Radar Baseboard and retry the connection.

Make some movement in front of the radar board and observe the measured speed and detected direction on the GUI. You may also observe the light from the RGB LED changing with regards to the motion and its direction.

Expand Down
Loading

0 comments on commit 2c0fc3c

Please sign in to comment.