all BT example projects from web hang down this call string bt_enable -> bt_settings_init -> settings_subsys_init
blinky example runs fine
all BT example projects from web hang down this call string bt_enable -> bt_settings_init -> settings_subsys_init
blinky example runs fine
Hi Michael,
Do you have an external low frequency crystal on your custom board?
If not, then you have to configure the board to use the internal RC oscillator instead.
Add this to your project config file:
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
regards
Jared
the Fanstel EV-BT832F does have a 32k xtal installed on P000 and P001.
I put the two lines of code into files: prj.conf & prj_minimal.conf
no change
Hi,
Which NCS version are you using?
Can you add CONFIG_RESET_ON_FATAL_ERROR=n to your project config file, this will prevent the program from resetting when it hits an error. The serial log should specify the error causing the program to assert. Can you share the log output?
regards
Jared
Not sure what NCS is or serial log
Visual Code Studio - about
Version: 1.75.0 (user setup)
Commit: e2816fe719a4026ffa1ee0189dc89bdfdbafb164
Date: 2023-02-01T15:23:45.584Z
Electron: 19.1.9
Chromium: 102.0.5005.194
Node.js: 16.14.2
V8: 10.2.154.23-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: No
Output from USB
Hi,
MikeDale said:Output from USB
I'm interested in reading log from the "output from USB" when the program asserts.
MikeDale said:Debug Consol:JLinkGDBServerCL: SEGGER J-Link GDB Server V7.66a Command Line Version JLinkGDBServerCL: JLinkGDBServerCL: JLinkARM.dll V7.66a (DLL compiled May 19 2022 15:18:08) JLinkGDBServerCL: JLinkGDBServerCL: -----GDB Server start settings----- JLinkGDBServerCL: GDBInit file: none JLinkGDBServerCL: GDB Server Listening port: 58659 JLinkGDBServerCL: SWO raw output listening port: 2332 JLinkGDBServerCL: Terminal I/O port: 2333 JLinkGDBServerCL: Accept remote connection: localhost only JLinkGDBServerCL: Generate logfile: off JLinkGDBServerCL: Verify download: off JLinkGDBServerCL: Init regs on start: off JLinkGDBServerCL: Silent mode: on JLinkGDBServerCL: Single run mode: on JLinkGDBServerCL: Target connection timeout: 0 ms JLinkGDBServerCL: ------J-Link related settings------ JLinkGDBServerCL: J-Link Host interface: USB JLinkGDBServerCL: J-Link script: none JLinkGDBServerCL: J-Link settings file: none JLinkGDBServerCL: ------Target related settings------ JLinkGDBServerCL: Target device: nRF52832_xxAA JLinkGDBServerCL: Target interface: SWD JLinkGDBServerCL: Target interface speed: 12000kHz JLinkGDBServerCL: Target endian: little JLinkGDBServerCL: =thread-group-added,id="i1" =cmd-param-changed,param="pagination",value="off" arch_system_halt (reason=reason@entry=2) at C:/ncs/v2.2.0/zephyr/kernel/fatal.c:32 32 for (;;) { [New Remote target] [New Thread 536880864] [New Thread 536880680] [New Thread 536877408] [New Thread 536878680] [New Thread 536880464] [New Thread 536881048] [New Thread 536877176][Switching to Thread 536880864]Thread 3 hit Breakpoint 1, main () at ../src/main.c:562562 {Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)
Looking at your debug log, it looks like you either put a breakpoint at the start of main or that you don't start the execution of the program after starting the debugger. Could you just flash the program without starting debugger and share the log output from the USB when it asserts?
Please set CONFIG_RESET_ON_FATAL_ERROR=n in the project config as well.
regards
Jared
trying to connect from android terminal
"connect failed gatt status 133"
added printk to main
pristine build
uart init succeeds
trying to connect from android terminal
"connect failed gatt status 62"
also LED1 is blinking - 1 sec rate
added printk to main
pristine build
uart init succeeds
trying to connect from android terminal
"connect failed gatt status 62"
also LED1 is blinking - 1 sec rate
Hi Michael,
MikeDale said:uart init succeeds
trying to connect from android terminal
"connect failed gatt status 62"
MikeDale said:Just the nRF52 Development Kit. Hangs up & resets at err = bt_enable(NULL)
Ok, I'm assuming that you're able to get the device advertising since you're trying to connect to it from the android phone, and that the device doesn't reset at bt_enable() as before. What application are you using on your android phone, is it nRF Connect mobile app or are you still testing with the Fanstel mobile apps? What phone are you using?
MikeDale said:Not sure what NCS is
It stands for nRF Connect SDK (NCS), what NCS version are you using? GATT Status 62 (BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED) is a general error code which can be caused by multiple reasons such as the peer not responding to the connection request.
regards
Jared
Still fails at the same place.
I deleted all nordic apps and directory's from my windows 11 pc.
Reinstalled - no change
Tried older toolchain - no change
it's not advertising - my android terminal emulator remembered it from the factory ship pairing
Do you have an android phone that you can test this with? If the board is blinking then it usually indicates that the board is advertising. Please try to scan the device running unmodified peripheral_uart on the DK, and use the nRF Connect mobile to scan for the advertisement.
Also, make sure that you aren't running the sample in debug mode with breakpoints set.
One more thing, the gatt status error code, did you read this from the android app or from the log output from the nRF5340?
regards
Jared
tried again and your right
- my deleting and reinstalling all Nordic stuff seems to have gotten me past the fail at bt_enable(). Just stepped past in debugger.
Where does the LOG_INF statement log to - I see no results in my terminal window
Ok, so now you're able to get it advertising? Do you see the board advertising in the nRF Connect mobile app?
The log statements goes out on the serial terminal, if you're using the nRF52832 development kit then you should see the log output on the same virtual port that the Zephyr boot log is printed on.
regards
Jared