I'm using the KT9Z1J638 eval board with the KT9Z1_638_SCI_demo firmware project and unable to achieve reliable sleep with wake on PTB4.
I'm not using CAN or LIN, but instead plan to transfer measurement data over SPI to another system. The application will use sleep mode and the wake on PTB4 and wake on current threshold features.
I can put the demo code to sleep by setting bmsmode=BMS_SLEEP, and wake on PTB4 rising edge (press BP3), but it isn't reliable -- it seems to work exactly once after full power cycle, USB connect, and reflashing the firmware. Subsequent attempts to enter sleep mode hang with 15mA supply current drain.
Also tested standalone (without USB attached). With S1-1 open (RESET_A and RESET not connected), when VBAT is applied, it hangs consistently, again with the 15mA drain. Hardware RESET gets it going, but then it hangs after entering sleep mode, again with the 15mA.
With S1-1 closed (RESET_A and RESET tied together), the system starts reliably at power on, but when the code enters sleep mode, the system immediately restarts through reset.
I suspected it was hanging in d2d.c:isrd2derr, and confirmed my suspicion by pulsing a debug output inside the loop.