2024-12-11 06:53 AM
Hello together,
I'm writing code that is supposed to write a message to the ftm mailbox. For the setup I authorize FTM in MB_MODE. Also I enable FTM via MB_EN. After that I'm writing to the mailbox. On my oscilloscope I can see that the device sends the correct data. Basically the same as in AN4910 Table 13 but my data is different. So I'm sending Start sA6 rAck s20 rAck s08 rAck sCA. The address (2008h) gets acknowledged, but the first data byte (CAh) not. After this the MCU is not sending any more data since it registers the NAck.
I made sure that all the registers are in the correct state. Here is the debug pring just before writing the data:
DEBUG mb_ctrl: MbCtrlDyn { mb_en: true, host_put_msg: false, rf_put_msg: false, host_miss_msg: false, rf_miss_msg: false, host_current_msg: false, rf_current_msg: false }
└─ st25dv::fast_transfer_mode::{impl#1}::debug::{async_fn#0}
DEBUG mb_len: MbLenDyn { mb_len: 0 }
└─ st25dv::fast_transfer_mode::{impl#1}::debug::{async_fn#0}
DEBUG ftm: Ftm { mb_mode: true, mb_wdg: 0 }
└─ st25dv::fast_transfer_mode::{impl#1}::debug::{async_fn#0}
DEBUG eh_ctrl_dyn: EhCtrlDyn { eh_en: false, eh_on: false, field_on: false, vcc_on: true }
└─ st25dv::fast_transfer_mode::{impl#1}::debug::{async_fn#0}
DEBUG write: address=83, write=[2, 8, 202]
└─ embassy_stm32::i2c::{impl#15}::write
ERROR panicked at src/main.rs:149:37:
called `Result::unwrap()` on an `Err` value: Nack
Can anyone help tell me what I'm missing? Btw, reading a message which was sent from RF works.
Solved! Go to Solution.
2024-12-11 06:58 AM
Sorry to have bothered anyone. I just realized that I mistakenly wrote 0x02 instead of 0x20. Thus the address 0x0208 was sent, not 0x2008. I didn't see this the whole time. Now it works.
2024-12-11 06:58 AM
Sorry to have bothered anyone. I just realized that I mistakenly wrote 0x02 instead of 0x20. Thus the address 0x0208 was sent, not 0x2008. I didn't see this the whole time. Now it works.