STM8L: Need to use active halt mode

I'm having trouble getting active halt mode to work on an STM8L. I can get it to wake up from a halt condition using an external interrupt. However, when I try to do the same thing using the real-time clock, it doesn't work.

Does anyone have some sample code that I can use for placing this thing into active halt and having it wake up based on the RTC? Again, this is for the STM8L.