2013-06-25 02:00 AM
Hello all,
I am trying to make the chip to communicate with the PC. My code did not work and I want to debug the code. But I cannot control what happens when data is received. In the debug mode, the code never enters in the interrupt handler. How can I see what does the program do when it receives data from the PC?Thanks a lot in advance.Best regards,Gunay #usart #debug #interrupt #iar2013-06-25 02:07 AM
In the debug mode, the code never enters in the interrupt handler.
Perhaps the interrupt is not properly initialized/enabled. Posting the relevant code could help. Usually, you can configure the debugger to step in at the reset handler, or at the begin of main. Does that work, can you single-step through your code ?
2013-06-25 02:22 AM
2013-06-25 02:56 AM
I can't spot a grave mistake at first glance.
Does it send, i.e. do you see character transmission ? It's always good to check with a scope what actually happens at the bus lines. You have only the RXNE interrupt enabled. This requires a correct character transmission. Can you check that your project sees a proper HSE_VALUE preprocessor definition ? A common problem is to not have a matching define for this value, which specifies your ext. quartz frequency. If not defined, a default value of 25.000.000 from stm32f4xx.h (line 104 at my version) takes effect.2013-06-25 03:47 AM
I'm using a serial port terminal. I could not read any data from the driver. I can send data from PC but don't know what happens to that sent data.
I've checked HSE value, it matches with mine, no problem there.2013-06-25 04:30 AM
I'm using a serial port terminal. I could not read any data from the driver. I can send data from PC but don't know what happens to that sent data.
With a level shifter like the MAX232, I hope. Otherwise, the peripheral could be dead already. Is the wiring correct (RX/TX swapped) ? How about a scope ? Something happening on the RX / TX lines ?
2013-06-25 04:37 AM
I'm using a USB to RS422 converter :
http://www.elektroniktasarim.net/index.php?id_product=17&controller=product
I also used the Eltima software's advanced serial port terminal 5.5I hope I did not kill anything :DI could not use a scope yet. I will update the post as I do.2013-06-25 04:50 AM
Does the board have RS422 output? The STM32 has CMOS levels.
Do you see any output from the serial port? What is GPIO C doing? Controlling an RS422 converter?2013-06-25 04:57 AM
The board has RS422 Output.
GPIOC_2 is receive enable (active low) andGPIOC_3 is device enable for the RS422 transreceiver.And, no, I don't see anything from the serial port. I just see the data I tried to send from PC. When I send it USB-RS422 converter's data transmission led blinks but the board does not send anything back2013-06-25 05:01 AM
I'm using a USB to RS422 converter : ...
RS422 is differential, i.e. has RX+, RX-, TX+, TX-, but no GND. Not sure how you would have connected it, and where. The STM32 UART pins are GND based, CMOS level (3.3V).I hope I did not kill anything :D
I hope so, too.