Skip to content

PSOC6: send HCI reset after patch RAM download #9821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ static const uint8_t pre_brcm_patchram_buf[] = {
0x03, 0x0C, 0x00,
0x2E, 0xFC, 0x00,
};
static const uint8_t post_brcm_patchram_buf[] = {
// RESET cmd
0x03, 0x0C, 0x00,
};

static const int pre_brcm_patch_ram_length = sizeof(pre_brcm_patchram_buf);
static const int post_brcm_patch_ram_length = sizeof(post_brcm_patchram_buf);

#define HCI_RESET_RAND_CNT 4
#define HCI_VS_CMD_SET_SLEEP_MODE 0xFC27
Expand Down Expand Up @@ -278,12 +284,24 @@ class HCIDriver : public cordio::CordioHCIDriver {
{
service_pack_ptr = brcm_patchram_buf;
service_pack_length = brcm_patch_ram_length;
service_pack_next = &HCIDriver::terminate_service_pack_transfert;
service_pack_next = &HCIDriver::post_service_pack_transfert;
service_pack_index = 0;
service_pack_transfered = false;
send_service_pack_command();
}

// Called once brcm_patchram_buf has been transferred; send post_brcm_patchram_buf
void post_service_pack_transfert(void)
{
service_pack_ptr = post_brcm_patchram_buf;
service_pack_length = post_brcm_patch_ram_length;
service_pack_next = &HCIDriver::terminate_service_pack_transfert;;
service_pack_index = 0;
service_pack_transfered = false;
wait_ms(1000);
send_service_pack_command();
}

// Called once post_brcm_patchram_buf has been transferred; start regular initialization.
void terminate_service_pack_transfert(void)
{
Expand All @@ -292,7 +310,6 @@ class HCIDriver : public cordio::CordioHCIDriver {
service_pack_next = NULL;
service_pack_index = 0;
service_pack_transfered = true;
wait_ms(1000);
set_sleep_mode();
}

Expand Down