Hi,
I had try to your code using Atollic with stm32f407zgt and stm32f407igt,
(both china both), I got 2 different result. I Just testing the code without
connecting to any hardware - stepper, switch and etc.
a) 407ZGT it work -- luckily it.
b) 407IGT it work but it stopped with click the Unlock from the Candle2.0
- when the board start, on candle it got ERROR:Unknown or ERROR:9
- when candle send $X and received OK
- following candle send the spindle speed S10000 but not received OK
and stop here.
what could be the problem?
BTW, I suggest when USART_NUM = 1, code under the stm32f4xx_it.c,
added this checking, it can work without any changes ... just like when
run it, wonder why the candle not showing the real time status and position.
a)
void USART1_IRQHandler(void)
{
if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET) {
/* Read one byte from the receive data register */
unsigned char c = (USART_ReceiveData(USART1) & 0xFF);
// Write character to buffer
if ( 1 == USART_NUM ) // Added this checking
ProcessReceive( c );
else
FifoUsart_Insert(USART1_NUM, USART_DIR_RX, c);
}
b)
void ProcessReceive(char c)
{
...
...
}
else {
// Write character to buffer
if ( 1 == USART_NUM ) // Added this
FifoUsart_Insert(USART1_NUM, USART_DIR_RX, c); // Added this checking
else
FifoUsart_Insert(USART2_NUM, USART_DIR_RX, c);
}
}
}
TQ.