Hello,
I currently have difficulties enabling whitening on RX frames on the NXP FRDM MKW36 development board. The goal is to develop a basic Bluetooth Low Energy (BLE) 4.2 stack on top of the Generic FSK (GENFSK) link layer.
Receiving frames works just fine, except that whitening is not applied to them. Thus handling of the length field and CRC checking in hardware are not possible. I verified the lack of whitening with an external sniffer/radio logic analyzer (see appendix). AFAIK the correct registers are set, but can you please list the necessary registers? I did configure these (C-style pseudo-code):
RX_WHITEN_DIS = 0u
TX_WHITEN_DIS = 0u
WHITEN_START = 0b01u
WHITEN_SZ_THR = 0u
WHITEN_PAYLOAD_INIT = 0u
WHITEN_END = 1u
WHITEN_SZ = 7u
WHITEN_INIT = (reverse_bits_of_byte(ble_channel_index) >> 1) | 1u
WHITEN_POLY = 0b1000100u
WHITEN_POLY_TYPE = 0u
WHITEN_B4_CRC = 0u
WHITEN_REF_IN = 0u
Are the above settings sufficient? What is required to enable whitening?
What might cause the whitening to not be applied?
As a side note: I noticed "WHITEN_SEED[31:0]" and "WHITEN_SEED[8:0]" being mentioned in the Reference Manual on a few pages (pp. 1927, 1930, 1947, 1948), but there is no actual register being called like that. Shouldn't it have been WHITEN_INIT? You can find it with Ctrl+F and the word "WHITEN_SEED".
Sadly I could not find any examples of BLE being developed on the GENFSK stack.
Thanks a lot in advance!
Regards
Felix
Appendix: Example of a received frame and what would be the expected frame
As I receive it (i.e. without whitening):
D6 E4 0D 20 59 DE B3 A9 19 A4 B5 41 78 F0 33
73 14 72 23 D0 20 EE B3 1F 49 3B F7 44 29 2B
E3 20 61 E0 E6 56 36 9E
As it should show up in the packet buffer:
00 21 49 00 00 00 52 26 02 01 1A 03 03 BE FE
13 FF 10 01 40 0C 01 43 D8 C4 E9 A0 E5 14 8C
85 90 14 D1 F7 1E A0 E9
Hello,
Just to confirm, basically you want to filter the packets received? Or what exactly are you referring with whitening ?
is there a specific reason why you are not working with the available Bluetooth LE examples in the SDK ?
Regards
Dear Estephania,
Did you have time to have a further look at this issue? It would be very helpful to receive your comments on the configuration, and what config is required (instead?). AFAIK according to the documentation the above should be sufficient, and I do not know how to further debug this issue since the details of the whitening are largely inaccessible from software.
Maybe there is an example of using BLE on the GENFSK layer? Maybe someone else has some experience with this problem?
Thanks in advance & Regards
Felix D.
Hello,
Sorry for the late reply, as there are no examples of what you are looking for I'm trying to investigate further in the topic and to have an exact answer to your problem might take a lot of time.
Still, I have been looking and it would seem that in the hybrid example for Bluetooth and GenFSK there are some whitening definitions and setup needed,
Have you checked the _GENFSK_whitener_config type definition in the genfsk_interface.h file ?
Also you can check the GENFSK_SetWhitenerConfig function of the available APIs.
I was able to locate this document, but still, it's the closest element to what you are looking for.
Could you please check those and let me know if those are helpful ?
Regards ,
Estephania
Hello Estephania,
have you found a reason why WHITEN_SEED is described strangely in the documentation (see original post)? It's not in the memory map and varies in size. Maybe that value is never set and thus whitening thus has no effect?
Regards
Felix D.
Hello,
The only extra I have found by now it's that whitenseed is set as bit reversed, it would seem that the information on the Reference Manual it's all we have available, still , something that it's not quite clear for me it's why you are not using the genfsk_ll files that we provide with the APIs to set the whitener.
There is a .c file and a .h file if you consider and map correctly the channels to use considering that Bluetooth LE need a special whitening for each channel , with our current load of work I cant really make an example code as this it's such a custom software.
Sorry for the inconveniences this might cause you. Could you please try checking those APIs?
Regards,
Estephania
Hello,
Thank you for your help so far! I did already have a look at them, and they do seem to set the very same registers as I do. It only confirms that the config is probably correct for the large part, and that there is probably only a small detail missing.
The document you found did not really help me, since it does not mention how whitening is enabled. AFAIK they basically use some specific stack rather than BLE on the GENFSK layer.
Regards,
Felix
Hello Estephania!
Yes, I want to de-whiten the frames such that there will be less load on the MCU and in order for the hardware to already apply filtering, take care of the length of the packet and also calculate the CRC in hardware.
Dewhitening refers to the process described in the Bluetooth Specification (here) Version 5.1, Vol. 6 Core System Package [Low Energy Controller volume], Part B Link Layer Specification, Section 2.3 Data Whitening (pp. 2738).
The reason for us to not be able to use the kindly provided examples from the SDK is that they build on the BLE-specific Link Layer. In this research project we require the flexibility of the GENFSK Link Layer an can thus not use the provided examples as guidance. They indeed were helpful in configuring the lower layers but not this more specific part of the system (the Link Layer).
Regards
Felix