XMC1100 - special UART Command to leave User Productive Mode

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User11140
Level 1
Level 1
Hello,

I´m trying to send a command (string = LED_ON) with HTerm to switch on/off a LED.
Is this possible with the Pin0.14 and Pin0.15 at the XMC1100 Boot Kit ?

I´m looking for a solution for changing the BMI back to ASC_BSL mode when receiving a special command via UART.

So hopefully it is possible to change the BMI with a command with using the Pin0.14/Pin0.15.

Is there somewhere an example ?
0 Likes
7 Replies
lock attach
Attachments are accessible only for community members.
chismo
Employee
Employee
First like received
Hello,

I created a simple example that does the following:
- Toggles LED P0.0 in a while loop
- Waits for the hypterterminal to send two consecutive bytes corresponding to the required BMI value (@19.2kbaud)
- Upon receiving the two bytes, trigger a RXFIFO interrupt to call the BMI installation request user routine with the received BMI value as inputs.
- For example, to switch BMI to ASC, BMI value should be 0xFFCO. In this case, hyperterminal must send byte 0 = 0xC0, followed by byte 1 = 0xFF.
- After reception, the LED stops blinking since device is in ASC_BSL mode.
- The device needs to be unplugged and plugged again and now, a read back of the BMI status (DAVE's get BMI button) shows ASC_BSL.

Attached is the main.c file in text format:


Can you have a look and hopefully it is helpful to you?

Regards,
Min Wei
0 Likes
chismo
Employee
Employee
First like received
Just to add that the virtual COM port supports UART communication with only P1.2 and P1.3 as in the above example.
I don't think P0.14 and P0.15 can be used in this case.

Regards,
Min Wei
0 Likes
User11140
Level 1
Level 1
Thank you. thats what i need
0 Likes
Not applicable
Min Wei (chismo),

Is there a 'bug' in your USIC IRQHandler function? Inside your if() statement is a logical AND, "&&". Did you mean a bit-wise AND, "&"?


if((XMC_USIC_CH_RXFIFO_GetEvent(XMC_UART0_CH1)&&XMC_USIC_CH_RXFIFO_EVENT_STANDARD)==1)



Did you mean this:


if((XMC_USIC_CH_RXFIFO_GetEvent(XMC_UART0_CH1) & XMC_USIC_CH_RXFIFO_EVENT_STANDARD) == 1)


Steve.
0 Likes
chismo
Employee
Employee
First like received
Hi Steve,

Thanks for the feedback.

It is not a bug because I am using the XMC Lib function XMC_USIC_CH_RXFIFO_GetEvent(), which extracts only the bit SRBI from register TRBSR.
If I had directly read out the register, then yes, only a bitwise operation would work.
For example:

if(( XMC_UART0_CH1->TRBSR & XMC_USIC_CH_RXFIFO_EVENT_STANDARD) == 1)
// if(( XMC_UART0_CH1->TRBSR && XMC_USIC_CH_RXFIFO_EVENT_STANDARD) == 1) will fail.


Regards,
Min Wei
0 Likes
Not applicable
Hi,
I tried to run the example above. After that I could not debug any more.
Whenever I launch a debugging, an error occur: J-Link GDB Server failed: Could not connec to target. Please check if target i powered and if ribbon cable is plugged properly.


SEGGER J-Link GDB Server V5.02h Command Line Version

JLinkARM.dll V5.02h (DLL compiled Oct 29 2015 19:04:05)

-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: localhost only
Generate logfile: off
Verify download: on
Init regs on start: on
Silent mode: off
Single run mode: on
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: XMC1100-T038x0064
Target interface: SWD
Target interface speed: 1000kHz
Target endian: little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link Lite-XMC4200 Rev.1 compiled Oct 27 2015 17:41:01
Hardware: V1.00
S/N: 591002665
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...ERROR: Could not connect to target.
Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
Shutting down...



Could you please have a look at this. I can't work with my XMC Kit now.
Thanks
Bien
0 Likes
chismo
Employee
Employee
First like received
Hello,

Can you check what is the current BMI mode for the device?
2207.attach

If it is ASC mode, can you switch to User mode (debug) SWD0?

Or do you mean the device is totally not accessible anymore?

Regards,
Min Wei
0 Likes