cancel
Showing results for 
Search instead for 
Did you mean: 

How to respond NACK to Master

PYF.1
Associate II

Hello everyone,

I have a application on STM32L5xx, I configuration I2C1 to slave mode,

when slave receive first unwanted command code, I want to response NACK to master. I judge the command code in AL_SMBUS_SlaveRxCpltCallback call back function, and set NACK bit at CR2 register but unfortunately cannot success.

2 REPLIES 2
Bubbles
ST Employee

Hi @PYF.1​ ,

to get the ACK control, you need to configure slave byte control mode. The settings are SBC=1, RELOAD=1, NBYTES=1. NOSTRETCH=0. The slave byte control is a whole chapter in the reference manual.

BR,

J

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

PYF.1
Associate II

Hi JUUDO,

Thanks for your answer, here I ignore the RELOAD=1, now I could control the ACK at eacch byte

determine response ACK/NACK to master

BR

PYF