mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-29 03:32:49 +00:00
zephyr: on nrf5340_cpuapp increase clock to 128MHz
This commit is contained in:
parent
c169b70d58
commit
81b4771675
@ -18,7 +18,10 @@
|
|||||||
#include <zephyr/bluetooth/hci_raw.h>
|
#include <zephyr/bluetooth/hci_raw.h>
|
||||||
|
|
||||||
// Nordic NDK
|
// Nordic NDK
|
||||||
|
#if defined(CONFIG_HAS_NORDIC_DRIVERS)
|
||||||
#include "nrf.h"
|
#include "nrf.h"
|
||||||
|
#include <nrfx_clock.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// BTstack
|
// BTstack
|
||||||
#include "btstack_debug.h"
|
#include "btstack_debug.h"
|
||||||
@ -147,7 +150,6 @@ static void transport_deliver_controller_packet(struct net_buf * buf){
|
|||||||
// btstack_run_loop_zephry.c
|
// btstack_run_loop_zephry.c
|
||||||
|
|
||||||
// the run loop
|
// the run loop
|
||||||
//static btstack_linked_list_t timers;
|
|
||||||
|
|
||||||
// TODO: handle 32 bit ms time overrun
|
// TODO: handle 32 bit ms time overrun
|
||||||
static uint32_t btstack_run_loop_zephyr_get_time_ms(void){
|
static uint32_t btstack_run_loop_zephyr_get_time_ms(void){
|
||||||
@ -208,7 +210,7 @@ static const btstack_run_loop_t * btstack_run_loop_zephyr_get_instance(void){
|
|||||||
|
|
||||||
static btstack_packet_callback_registration_t hci_event_callback_registration;
|
static btstack_packet_callback_registration_t hci_event_callback_registration;
|
||||||
|
|
||||||
static bd_addr_t local_addr;
|
static bd_addr_t local_addr = { 0 };
|
||||||
|
|
||||||
void nrf_get_static_random_addr( bd_addr_t addr ) {
|
void nrf_get_static_random_addr( bd_addr_t addr ) {
|
||||||
// nRF5 chipsets don't have an official public address
|
// nRF5 chipsets don't have an official public address
|
||||||
@ -218,9 +220,8 @@ void nrf_get_static_random_addr( bd_addr_t addr ) {
|
|||||||
big_endian_store_16(addr, 0, NRF_FICR->DEVICEADDR[1] | 0xc000);
|
big_endian_store_16(addr, 0, NRF_FICR->DEVICEADDR[1] | 0xc000);
|
||||||
big_endian_store_32(addr, 2, NRF_FICR->DEVICEADDR[0]);
|
big_endian_store_32(addr, 2, NRF_FICR->DEVICEADDR[0]);
|
||||||
#elif defined(CONFIG_SOC_SERIES_NRF53X)
|
#elif defined(CONFIG_SOC_SERIES_NRF53X)
|
||||||
// Using TrustZone this will only work in secure mode
|
big_endian_store_16(addr, 0, NRF_FICR->INFO.DEVICEID[1] | 0xc000 );
|
||||||
big_endian_store_16(addr, 0, NRF_FICR_S->INFO.DEVICEID[1] | 0xc000 );
|
big_endian_store_32(addr, 2, NRF_FICR->INFO.DEVICEID[0]);
|
||||||
big_endian_store_32(addr, 2, NRF_FICR_S->INFO.DEVICEID[0]);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,6 +308,11 @@ void bt_ctlr_assert_handle(char *file, uint32_t line)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
#if defined(CONFIG_SOC_SERIES_NRF53X)
|
||||||
|
// switch the nrf5340_cpuapp to 128MHz
|
||||||
|
nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1);
|
||||||
|
#endif
|
||||||
|
|
||||||
printf("BTstack booting up..\n");
|
printf("BTstack booting up..\n");
|
||||||
|
|
||||||
// start with BTstack init - especially configure HCI Transport
|
// start with BTstack init - especially configure HCI Transport
|
||||||
|
Loading…
x
Reference in New Issue
Block a user