Error in nRF5340 Audio DK sample application

I've been studying the CS47L63 register configuration file (cs47l63_reg_conf.h) included with the nr5340_audio application in extremely fine detail, and have discovered what I believe is an error.

The CS47L63 features two separate Audio Serial Ports (ASP1 and ASP2) on eight of its GPIO pins. ASP1 is correctly configured on pins 1-4 by setting each of their function registers to GPn_FN=0 (alternate pin-specific functions).

However the ASP2 GPIO pins 5-8 are seemingly incorrectly configured with their registers set to GPn_FN=1 (logic-level outputs), meaning that even if ASP2 is enabled, the P11 connector pins on the nRF5340 Audio DK labeled "Aux I2S" will never transceive their documented signals.

Shouldn't the ASP2 GPIO pins be configured to GPn_FN=0 just like the ASP1 GPIO? Is there a reason they've been disconnected from ASP2? I understand that they can be repurposed to output other interrupt and status signals, but shouldn't their default configuration match their labels and documentation?

Am I missing something, or did Nordic?

Parents
No Data
Reply
  • Here's a detail from "Figure 7: nRF5340 Audio DK codec" in the nRF5340 Audio DK User Guide, clearly stating that pins 5-8 are designated as AUX_I2S on ASP2.

    nRF5340 Audio DK codec schematic

    And here's another detail from "Figure 10: Interface connectors for onboard hardware codec" showing the P11 header labels for the AUX_I2S connector.

    nRF5340 Audio DK P11 AUX_I2S connecter

    Yet the register configuration file containing the CS47L63 codec's default settings in the nrf5340_audio application does not apply the correct values for these GPIO pins at all.

    cs47l63_reg_conf.h line 46:

    /* Set up GPIOs */
    const uint32_t GPIO_configuration[][2] = {
        { CS47L63_GPIO6_CTRL1, 0x61000001 },
        { CS47L63_GPIO7_CTRL1, 0x61000001 },
        { CS47L63_GPIO8_CTRL1, 0x61000001 },
        
        /* Enable CODEC LED */
        { CS47L63_GPIO10_CTRL1, 0x41008001 }
    };

    The values for GPIO 6-8 above set the following register labels:

    GPn_FN =      1 (logic level output)
    GPn_POL =     0 (polarity active high)
    GPn_DB =      0 (debounce disabled)
    GPn_OP_CFG =  0 (output config CMOS)
    GPn_LVL =     0 (output level low)
    GPn_DBTIME =  0 (debounce time 100µs)
    GPn_DRV_STR = 1 (drive strength 8mA)
    GPn_PD =      1 (pulldown enabled)
    GPn_PU =      1 (pullup enabled)
    GPn_DIR =     0 (direction output)

    That configuration does NOT match the schematic, the documentation, nor the silkscreen on the physical board. Since this is literally the only working code provided for the nRF5340 Audio DK, it is inarguably wrong.

    The ASP1 GPIO are correctly configured a few lines later, though for some inexplicable reason GPIO 5 has been grouped here and is also configured incorrectly.

    cs47l63_reg_conf.h line 115:

    /* Set up ASP1 (I2S) */
    const uint32_t asp1_enable[][2] = {
    	/* Enable ASP1 GPIOs */
    	{ CS47L63_GPIO1_CTRL1, 0x61000000 },
    	{ CS47L63_GPIO2_CTRL1, 0xE1000000 },
    	{ CS47L63_GPIO3_CTRL1, 0xE1000000 },
    	{ CS47L63_GPIO4_CTRL1, 0xE1000000 },
    	{ CS47L63_GPIO5_CTRL1, 0x61000001 },

    To actually match the intended and documented functionality of the development kit, the GPIOn_CTRL1 registers for pins 1-8 should all be set to 0xE1000000, which configures each label to its default value, except for GPn_FN=0 which configures dedicated ASP1/2 functions and overrides individual label values as required.

    Here's how the code, in my opinion, SHOULD read:

    /* Set up GPIOs (Aux I2S, repurpose as needed) */
    const uint32_t GPIO_configuration[][2] = {
        { CS47L63_GPIO5_CTRL1, 0xE1000000 },
        { CS47L63_GPIO6_CTRL1, 0xE1000000 },
    	{ CS47L63_GPIO7_CTRL1, 0xE1000000 },
    	{ CS47L63_GPIO8_CTRL1, 0xE1000000 },

    /* Set up ASP1 (I2S) */
    const uint32_t asp1_enable[][2] = {
    	/* Enable ASP1 GPIOs */
    	{ CS47L63_GPIO1_CTRL1, 0xE1000000 },
    	{ CS47L63_GPIO2_CTRL1, 0xE1000000 },
    	{ CS47L63_GPIO3_CTRL1, 0xE1000000 },
    	{ CS47L63_GPIO4_CTRL1, 0xE1000000 },

    Is this not an error in need of correction?

Children
Related