LPC804 not leaving while loop

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC804 not leaving while loop

ソリューションへジャンプ
583件の閲覧回数
lennartpt
Contributor I

So I'm using an LPC804 with a slightly adjusted version of the SBL as of AN12378. The SBL executes correctly and switches to another Program. This program is basically used for IAP via SPI. 

However the slave never leaves the loop waiting for the finish of the Data Transfer. ALTHOUGH the loop condition is FALSE after the transmission finishes. I have actually no idea why the chip is behaving like this...

variable false.png

0 件の賞賛
1 解決策
566件の閲覧回数
carstengroen
Senior Contributor II

The variable, slaveActive, I assume that is being set by an interrupt routine ?

Make sure that slaveActive is defined as being "volatile", otherwise the while loop will not read it from actual memory (but rather keep it in a register...)

 

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
567件の閲覧回数
carstengroen
Senior Contributor II

The variable, slaveActive, I assume that is being set by an interrupt routine ?

Make sure that slaveActive is defined as being "volatile", otherwise the while loop will not read it from actual memory (but rather keep it in a register...)

 

0 件の賞賛
562件の閲覧回数
lennartpt
Contributor I

Wow, I had many different problems besides this one, also tried using volatile before, but obviously not in the same constellation... and then such a simple change fixes all of my problems at once..

Thanks..

0 件の賞賛