-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
[TW#27735] Bluetooth GAP/A2DP affecting Pulse Counter #2786
Comments
Hi @markingle , |
Thanks @blueMoodBHD! I have already tried Core 1 for the pulse counter but it did not correct the problem. I’ll test again and post the results along with my code changes for your review. |
@blueMoodBHD Here the function I am using to pin the detect_metal function to Core 1: xTaskCreatePinnedToCore(detect_metal, "DetectMetal_Task", 3000, NULL, 1, &DetectMetal_Task, 1); Below are calibration logs and the interference. The interference with the pulse counter doesn't start until sound starts coming out of the speaker. Also here is a portion of the log showing the calibration and pulse counter running on Core 1.... Determining frequency average on start up Partial log of BT interfering with the pulse counter.... Analyzing frequency data to detect metal.... |
I increased the priority to 3 and it helped a little. The frequency change trigger isn’t tripped as often but it gets worse over time. Here is a video demonstrating the issue. |
This issue was fixed by pinning the pulse_count function to Core 1 and eliminating a gpio handler function that was not needed |
This issue was fixed by pinning the pulse_count function to Core 1 and eliminating a gpio handler function that was not needed |
Environment
git describe --tags
to find it): v3.3-dev-337-g1cffc90xtensa-esp32-elf-gcc --version
to find it):xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 5.2.0Problem Description
I am using the pulse counter functions to monitor a signal coming in on GPIO4. When the program starts up it creates an average based on the difference between the first and second reading, which is one sample. Ten (10) samples are taken to determine the average difference. Here is the serial output from the first sample:
Start calibration....pass #0
Startup Calibration Pulse Counter is on - Core: 0
First counter value for calibration:171
Second counter value for calibration:183
Count Difference: 12.000000
Once the sampling completes, subsequent readings are taken to determine if there is a change in frequency. If the difference between the first and second reading is > or < the average by 1 then I play a "beep" as an audible notification. I am using a potentiometer to change the frequency.
The code worked perfectly until I enabled Bluetooth GAP and A2DP. When GAP is initialized the BT_APPL layer does something to cause a delay in reading the second value thus causing the logic in the code to think the frequency has changed.....causing a beep. This should not happen.
Expected Behavior
Initializing BT GAP and A2DP should not impact the timing on checking the pulse counter. A beep should only play when the frequency changes.
Actual Behavior
The section where the problem occurs is in BOLD.
rst:0x1 (POWERON_RESET),boot:0x3a (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6164
load:0x40078000,len:10168
load:0x40080400,len:6552
entry 0x40080764
I (28) boot: ESP-IDF v3.3-dev-337-g1cffc90-dirty 2nd stage bootloader
I (28) boot: compile time 20:53:04
I (33) boot: Enabling RNG early entropy source...
I (35) boot: SPI Speed : 40MHz
I (39) boot: SPI Mode : DIO
I (43) boot: SPI Flash Size : 4MB
I (47) boot: Partition Table:
I (51) boot: ## Label Usage Type ST Offset Length
I (58) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (65) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (73) boot: 2 factory factory app 00 00 00010000 00100000
I (80) boot: End of partition table
I (84) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x40038 (262200) map
I (185) esp_image: segment 1: paddr=0x00050060 vaddr=0x3ff80000 size=0x00000 ( 0) load
I (186) esp_image: segment 2: paddr=0x00050068 vaddr=0x3ff80000 size=0x00000 ( 0) load
I (192) esp_image: segment 3: paddr=0x00050070 vaddr=0x3ffbdb60 size=0x03d60 ( 15712) load
I (207) esp_image: segment 4: paddr=0x00053dd8 vaddr=0x3ffc18c0 size=0x00000 ( 0) load
I (210) esp_image: segment 5: paddr=0x00053de0 vaddr=0x40080000 size=0x00400 ( 1024) load
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
I (219) esp_image: segment 6: paddr=0x000541e8 vaddr=0x40080400 size=0x0be28 ( 48680) load
I (248) esp_image: segment 7: paddr=0x00060018 vaddr=0x400d0018 size=0xa2118 (663832) map
0x400d0018: _flash_cache_start at ??:?
I (481) esp_image: segment 8: paddr=0x00102138 vaddr=0x4008c228 size=0x083fc ( 33788) load
0x4008c228: esp_rom_spiflash_write at /Users/Mark/esp/esp-idf/components/spi_flash/spi_flash_rom_patch.c:475
I (495) esp_image: segment 9: paddr=0x0010a53c vaddr=0x400c0000 size=0x00000 ( 0) load
I (495) esp_image: segment 10: paddr=0x0010a544 vaddr=0x50000000 size=0x00000 ( 0) load
I (502) esp_image: segment 11: paddr=0x0010a54c vaddr=0x50000000 size=0x00000 ( 0) load
I (523) boot: Loaded app from partition at offset 0x10000
I (523) boot: Disabling RNG early entropy source...
I (525) cpu_start: Pro cpu up.
I (528) cpu_start: Starting app cpu, entry point is 0x40081214
0x40081214: call_start_cpu1 at /Users/Mark/esp/esp-idf/components/esp32/cpu_start.c:246
I (0) cpu_start: App cpu up.
V (539) memory_layout: reserved range is 0x3f440008 - 0x3f440058
D (545) memory_layout: Checking 12 reserved memory ranges:
D (550) memory_layout: Reserved memory range 0x3ffae000 - 0x3ffae6e0
D (557) memory_layout: Reserved memory range 0x3ffae6e0 - 0x3ffaff10
D (563) memory_layout: Reserved memory range 0x3ffb0000 - 0x3ffb6388
D (569) memory_layout: Reserved memory range 0x3ffb8000 - 0x3ffb9a20
D (576) memory_layout: Reserved memory range 0x3ffbdb28 - 0x3ffbdb5c
D (582) memory_layout: Reserved memory range 0x3ffbdb60 - 0x3ffd1738
D (589) memory_layout: Reserved memory range 0x3ffe0000 - 0x3ffe0440
D (595) memory_layout: Reserved memory range 0x3ffe3f20 - 0x3ffe4350
D (601) memory_layout: Reserved memory range 0x3fff8000 - 0x40000000
D (608) memory_layout: Reserved memory range 0x40070000 - 0x40078000
D (614) memory_layout: Reserved memory range 0x40078000 - 0x40080000
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
D (621) memory_layout: Reserved memory range 0x40080000 - 0x40094624
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
D (627) memory_layout: Building list of available memory regions:
V (633) memory_layout: Examining memory region 0x3ffae000 - 0x3ffb0000
V (640) memory_layout: Start of region 0x3ffae000 - 0x3ffb0000 overlaps reserved 0x3ffae000 - 0x3ffae6e0
V (649) memory_layout: Start of region 0x3ffae6e0 - 0x3ffb0000 overlaps reserved 0x3ffae6e0 - 0x3ffaff10
D (659) memory_layout: Available memory region 0x3ffaff10 - 0x3ffb0000
V (666) memory_layout: Examining memory region 0x3ffb0000 - 0x3ffb8000
V (672) memory_layout: Start of region 0x3ffb0000 - 0x3ffb8000 overlaps reserved 0x3ffb0000 - 0x3ffb6388
D (682) memory_layout: Available memory region 0x3ffb6388 - 0x3ffb8000
V (688) memory_layout: Examining memory region 0x3ffb8000 - 0x3ffc0000
V (695) memory_layout: Start of region 0x3ffb8000 - 0x3ffc0000 overlaps reserved 0x3ffb8000 - 0x3ffb9a20
V (705) memory_layout: Region 0x3ffb9a20 - 0x3ffc0000 contains reserved 0x3ffbdb28 - 0x3ffbdb5c
D (713) memory_layout: Available memory region 0x3ffb9a20 - 0x3ffbdb28
V (720) memory_layout: Examining memory region 0x3ffbdb5c - 0x3ffc0000
V (726) memory_layout: End of region 0x3ffbdb5c - 0x3ffc0000 overlaps reserved 0x3ffbdb60 - 0x3ffd1738
D (736) memory_layout: Available memory region 0x3ffbdb5c - 0x3ffbdb60
V (742) memory_layout: Examining memory region 0x3ffc0000 - 0x3ffc2000
V (749) memory_layout: Region 0x3ffc0000 - 0x3ffc2000 inside of reserved 0x3ffbdb60 - 0x3ffd1738
V (758) memory_layout: Examining memory region 0x3ffc2000 - 0x3ffc4000
V (764) memory_layout: Region 0x3ffc2000 - 0x3ffc4000 inside of reserved 0x3ffbdb60 - 0x3ffd1738
V (773) memory_layout: Examining memory region 0x3ffc4000 - 0x3ffc6000
V (780) memory_layout: Region 0x3ffc4000 - 0x3ffc6000 inside of reserved 0x3ffbdb60 - 0x3ffd1738
V (789) memory_layout: Examining memory region 0x3ffc6000 - 0x3ffc8000
V (795) memory_layout: Region 0x3ffc6000 - 0x3ffc8000 inside of reserved 0x3ffbdb60 - 0x3ffd1738
V (804) memory_layout: Examining memory region 0x3ffc8000 - 0x3ffca000
V (811) memory_layout: Region 0x3ffc8000 - 0x3ffca000 inside of reserved 0x3ffbdb60 - 0x3ffd1738
V (820) memory_layout: Examining memory region 0x3ffca000 - 0x3ffcc000
V (826) memory_layout: Region 0x3ffca000 - 0x3ffcc000 inside of reserved 0x3ffbdb60 - 0x3ffd1738
V (835) memory_layout: Examining memory region 0x3ffcc000 - 0x3ffce000
V (842) memory_layout: Region 0x3ffcc000 - 0x3ffce000 inside of reserved 0x3ffbdb60 - 0x3ffd1738
V (851) memory_layout: Examining memory region 0x3ffce000 - 0x3ffd0000
V (857) memory_layout: Region 0x3ffce000 - 0x3ffd0000 inside of reserved 0x3ffbdb60 - 0x3ffd1738
V (866) memory_layout: Examining memory region 0x3ffd0000 - 0x3ffd2000
V (873) memory_layout: Start of region 0x3ffd0000 - 0x3ffd2000 overlaps reserved 0x3ffbdb60 - 0x3ffd1738
D (882) memory_layout: Available memory region 0x3ffd1738 - 0x3ffd2000
V (889) memory_layout: Examining memory region 0x3ffd2000 - 0x3ffd4000
D (895) memory_layout: Available memory region 0x3ffd2000 - 0x3ffd4000
V (902) memory_layout: Examining memory region 0x3ffd4000 - 0x3ffd6000
D (909) memory_layout: Available memory region 0x3ffd4000 - 0x3ffd6000
V (915) memory_layout: Examining memory region 0x3ffd6000 - 0x3ffd8000
D (922) memory_layout: Available memory region 0x3ffd6000 - 0x3ffd8000
V (928) memory_layout: Examining memory region 0x3ffd8000 - 0x3ffda000
D (935) memory_layout: Available memory region 0x3ffd8000 - 0x3ffda000
V (942) memory_layout: Examining memory region 0x3ffda000 - 0x3ffdc000
D (948) memory_layout: Available memory region 0x3ffda000 - 0x3ffdc000
V (955) memory_layout: Examining memory region 0x3ffdc000 - 0x3ffde000
D (961) memory_layout: Available memory region 0x3ffdc000 - 0x3ffde000
V (968) memory_layout: Examining memory region 0x3ffde000 - 0x3ffe0000
D (975) memory_layout: Available memory region 0x3ffde000 - 0x3ffe0000
V (981) memory_layout: Examining memory region 0x3ffe0000 - 0x3ffe4000
V (988) memory_layout: Start of region 0x3ffe0000 - 0x3ffe4000 overlaps reserved 0x3ffe0000 - 0x3ffe0440
V (997) memory_layout: End of region 0x3ffe0440 - 0x3ffe4000 overlaps reserved 0x3ffe3f20 - 0x3ffe4350
D (1007) memory_layout: Available memory region 0x3ffe0440 - 0x3ffe3f20
V (1013) memory_layout: Examining memory region 0x3ffe4000 - 0x3ffe8000
V (1020) memory_layout: Start of region 0x3ffe4000 - 0x3ffe8000 overlaps reserved 0x3ffe3f20 - 0x3ffe4350
D (1030) memory_layout: Available memory region 0x3ffe4350 - 0x3ffe8000
V (1036) memory_layout: Examining memory region 0x3ffe8000 - 0x3fff0000
D (1043) memory_layout: Available memory region 0x3ffe8000 - 0x3fff0000
V (1050) memory_layout: Examining memory region 0x3fff0000 - 0x3fff8000
D (1056) memory_layout: Available memory region 0x3fff0000 - 0x3fff8000
V (1063) memory_layout: Examining memory region 0x3fff8000 - 0x3fffc000
V (1070) memory_layout: Region 0x3fff8000 - 0x3fffc000 inside of reserved 0x3fff8000 - 0x40000000
V (1079) memory_layout: Examining memory region 0x3fffc000 - 0x40000000
V (1085) memory_layout: Region 0x3fffc000 - 0x40000000 inside of reserved 0x3fff8000 - 0x40000000
V (1094) memory_layout: Examining memory region 0x40070000 - 0x40078000
V (1101) memory_layout: Region 0x40070000 - 0x40078000 inside of reserved 0x40070000 - 0x40078000
V (1110) memory_layout: Examining memory region 0x40078000 - 0x40080000
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
V (1117) memory_layout: Region 0x40078000 - 0x40080000 inside of reserved 0x40078000 - 0x40080000
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
V (1126) memory_layout: Examining memory region 0x40080000 - 0x40082000
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
0x40082000: esp_intr_noniram_disable at /Users/Mark/esp/esp-idf/components/esp32/intr_alloc.c:781
V (1132) memory_layout: Region 0x40080000 - 0x40082000 inside of reserved 0x40080000 - 0x40094624
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
0x40082000: esp_intr_noniram_disable at /Users/Mark/esp/esp-idf/components/esp32/intr_alloc.c:781
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
V (1141) memory_layout: Examining memory region 0x40082000 - 0x40084000
0x40082000: esp_intr_noniram_disable at /Users/Mark/esp/esp-idf/components/esp32/intr_alloc.c:781
0x40084000: spi_flash_mmap_pages at /Users/Mark/esp/esp-idf/components/spi_flash/flash_mmap.c:319
V (1148) memory_layout: Region 0x40082000 - 0x40084000 inside of reserved 0x40080000 - 0x40094624
0x40082000: esp_intr_noniram_disable at /Users/Mark/esp/esp-idf/components/esp32/intr_alloc.c:781
0x40084000: spi_flash_mmap_pages at /Users/Mark/esp/esp-idf/components/spi_flash/flash_mmap.c:319
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
V (1157) memory_layout: Examining memory region 0x40084000 - 0x40086000
0x40084000: spi_flash_mmap_pages at /Users/Mark/esp/esp-idf/components/spi_flash/flash_mmap.c:319
0x40086000: r_ld_fm_prog_push at ??:?
V (1164) memory_layout: Region 0x40084000 - 0x40086000 inside of reserved 0x40080000 - 0x40094624
0x40084000: spi_flash_mmap_pages at /Users/Mark/esp/esp-idf/components/spi_flash/flash_mmap.c:319
0x40086000: r_ld_fm_prog_push at ??:?
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
V (1172) memory_layout: Examining memory region 0x40086000 - 0x40088000
0x40086000: r_ld_fm_prog_push at ??:?
0x40088000: r_rwbt_sleep_wakeup at ??:?
V (1179) memory_layout: Region 0x40086000 - 0x40088000 inside of reserved 0x40080000 - 0x40094624
0x40086000: r_ld_fm_prog_push at ??:?
0x40088000: r_rwbt_sleep_wakeup at ??:?
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
V (1188) memory_layout: Examining memory region 0x40088000 - 0x4008a000
0x40088000: r_rwbt_sleep_wakeup at ??:?
0x4008a000: coex_unforce_wifi_mode at ??:?
V (1195) memory_layout: Region 0x40088000 - 0x4008a000 inside of reserved 0x40080000 - 0x40094624
0x40088000: r_rwbt_sleep_wakeup at ??:?
0x4008a000: coex_unforce_wifi_mode at ??:?
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
V (1204) memory_layout: Examining memory region 0x4008a000 - 0x4008c000
0x4008a000: coex_unforce_wifi_mode at ??:?
0x4008c000: esp_rom_spiflash_program_page_internal at /Users/Mark/esp/esp-idf/components/spi_flash/spi_flash_rom_patch.c:412
V (1210) memory_layout: Region 0x4008a000 - 0x4008c000 inside of reserved 0x40080000 - 0x40094624
0x4008a000: coex_unforce_wifi_mode at ??:?
0x4008c000: esp_rom_spiflash_program_page_internal at /Users/Mark/esp/esp-idf/components/spi_flash/spi_flash_rom_patch.c:412
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
V (1219) memory_layout: Examining memory region 0x4008c000 - 0x4008e000
0x4008c000: esp_rom_spiflash_program_page_internal at /Users/Mark/esp/esp-idf/components/spi_flash/spi_flash_rom_patch.c:412
0x4008e000: SEGGER_SYSVIEW_SendModule at /Users/Mark/esp/esp-idf/components/app_trace/sys_view/SEGGER/SEGGER_SYSVIEW.c:364
V (1226) memory_layout: Region 0x4008c000 - 0x4008e000 inside of reserved 0x40080000 - 0x40094624
0x4008c000: esp_rom_spiflash_program_page_internal at /Users/Mark/esp/esp-idf/components/spi_flash/spi_flash_rom_patch.c:412
0x4008e000: SEGGER_SYSVIEW_SendModule at /Users/Mark/esp/esp-idf/components/app_trace/sys_view/SEGGER/SEGGER_SYSVIEW.c:364
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
V (1235) memory_layout: Examining memory region 0x4008e000 - 0x40090000
0x4008e000: SEGGER_SYSVIEW_SendModule at /Users/Mark/esp/esp-idf/components/app_trace/sys_view/SEGGER/SEGGER_SYSVIEW.c:364
0x40090000: rtc_init at /Users/Mark/esp/esp-idf/components/soc/esp32/rtc_init.c:51
V (1242) memory_layout: Region 0x4008e000 - 0x40090000 inside of reserved 0x40080000 - 0x40094624
0x4008e000: SEGGER_SYSVIEW_SendModule at /Users/Mark/esp/esp-idf/components/app_trace/sys_view/SEGGER/SEGGER_SYSVIEW.c:364
0x40090000: rtc_init at /Users/Mark/esp/esp-idf/components/soc/esp32/rtc_init.c:51
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
V (1251) memory_layout: Examining memory region 0x40090000 - 0x40092000
0x40090000: rtc_init at /Users/Mark/esp/esp-idf/components/soc/esp32/rtc_init.c:51
0x40092000: vTaskPrioritySet at /Users/Mark/esp/esp-idf/components/freertos/tasks.c:4567
V (1257) memory_layout: Region 0x40090000 - 0x40092000 inside of reserved 0x40080000 - 0x40094624
0x40090000: rtc_init at /Users/Mark/esp/esp-idf/components/soc/esp32/rtc_init.c:51
0x40092000: vTaskPrioritySet at /Users/Mark/esp/esp-idf/components/freertos/tasks.c:4567
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
V (1266) memory_layout: Examining memory region 0x40092000 - 0x40094000
0x40092000: vTaskPrioritySet at /Users/Mark/esp/esp-idf/components/freertos/tasks.c:4567
0x40094000: block_data_size at /Users/Mark/esp/esp-idf/components/heap/multi_heap.c:377
(inlined by) multi_heap_realloc_impl at /Users/Mark/esp/esp-idf/components/heap/multi_heap.c:551
V (1273) memory_layout: Region 0x40092000 - 0x40094000 inside of reserved 0x40080000 - 0x40094624
0x40092000: vTaskPrioritySet at /Users/Mark/esp/esp-idf/components/freertos/tasks.c:4567
0x40094000: block_data_size at /Users/Mark/esp/esp-idf/components/heap/multi_heap.c:377
(inlined by) multi_heap_realloc_impl at /Users/Mark/esp/esp-idf/components/heap/multi_heap.c:551
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
V (1282) memory_layout: Examining memory region 0x40094000 - 0x40096000
0x40094000: block_data_size at /Users/Mark/esp/esp-idf/components/heap/multi_heap.c:377
(inlined by) multi_heap_realloc_impl at /Users/Mark/esp/esp-idf/components/heap/multi_heap.c:551
V (1289) memory_layout: Start of region 0x40094000 - 0x40096000 overlaps reserved 0x40080000 - 0x40094624
0x40094000: block_data_size at /Users/Mark/esp/esp-idf/components/heap/multi_heap.c:377
(inlined by) multi_heap_realloc_impl at /Users/Mark/esp/esp-idf/components/heap/multi_heap.c:551
0x40080000: _WindowOverflow4 at /Users/Mark/esp/esp-idf/components/freertos/xtensa_vectors.S:1685
D (1298) memory_layout: Available memory region 0x40094624 - 0x40096000
V (1305) memory_layout: Examining memory region 0x40096000 - 0x40098000
D (1312) memory_layout: Available memory region 0x40096000 - 0x40098000
V (1318) memory_layout: Examining memory region 0x40098000 - 0x4009a000
D (1325) memory_layout: Available memory region 0x40098000 - 0x4009a000
V (1332) memory_layout: Examining memory region 0x4009a000 - 0x4009c000
D (1338) memory_layout: Available memory region 0x4009a000 - 0x4009c000
V (1345) memory_layout: Examining memory region 0x4009c000 - 0x4009e000
D (1352) memory_layout: Available memory region 0x4009c000 - 0x4009e000
V (1358) memory_layout: Examining memory region 0x4009e000 - 0x400a0000
D (1365) memory_layout: Available memory region 0x4009e000 - 0x400a0000
I (1372) heap_init: Initializing. RAM available for dynamic allocation:
D (1379) heap_init: New heap initialised at 0x3ffaff10
I (1384) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
D (1390) heap_init: New heap initialised at 0x3ffb6388
I (1396) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
D (1402) heap_init: New heap initialised at 0x3ffb9a20
I (1407) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (1413) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAM
D (1419) heap_init: New heap initialised at 0x3ffd1738
I (1425) heap_init: At 3FFD1738 len 0000E8C8 (58 KiB): DRAM
I (1431) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1437) heap_init: At 3FFE4350 len 00013CB0 (79 KiB): D/IRAM
D (1444) heap_init: New heap initialised at 0x40094624
I (1449) heap_init: At 40094624 len 0000B9DC (46 KiB): IRAM
I (1455) cpu_start: Pro cpu start user code
D (1467) clk: RTC_SLOW_CLK calibration value: 3203277
V (134) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (135) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (140) intr_alloc: Connected src 46 to int 2 (cpu 0)
V (145) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (151) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xC0E
D (159) intr_alloc: Connected src 57 to int 3 (cpu 0)
I (164) esp_apptrace: Initialized TRAX on CPU0
V (169) esp_dbg_stubs: esp_dbg_stubs_init stubs 3ffce97c
V (176) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (181) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x40E
D (189) intr_alloc: Connected src 24 to int 9 (cpu 0)
I (194) cpu_start: Starting scheduler on PRO CPU.
I (536) esp_apptrace: Initialized TRAX on CPU1
V (0) intr_alloc: esp_intr_alloc_intrstatus (cpu 1): checking args
V (10) intr_alloc: esp_intr_alloc_intrstatus (cpu 1): Args okay. Resulting flags 0x40E
D (10) intr_alloc: Connected src 25 to int 2 (cpu 1)
I (20) cpu_start: Starting scheduler on APP CPU.
D (249) heap_init: New heap initialised at 0x3ffe0440
D (259) heap_init: New heap initialised at 0x3ffe4350
V (259) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (259) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (259) intr_alloc: Connected src 16 to int 12 (cpu 0)
D (279) ledc: LEDC_PWM CHANNEL 1|GPIO 18|Duty 0100|Time 1
D (289) nvs: nvs_flash_init_custom partition=nvs start=9 count=6
I (349) BTDM_INIT: BT controller compile version [d992edb]
D (349) BTDM_INIT: .data initialise [0x3ffae6e0] <== [0x4000d890]
D (349) BTDM_INIT: .bss initialise [0x3ffb0000] - [0x3ffb09a8]
D (349) BTDM_INIT: .bss initialise [0x3ffb09a8] - [0x3ffb1ddc]
D (359) BTDM_INIT: .bss initialise [0x3ffb1ddc] - [0x3ffb2730]
D (359) BTDM_INIT: .bss initialise [0x3ffb2730] - [0x3ffb6388]
D (369) BTDM_INIT: .bss initialise [0x3ffb8000] - [0x3ffb9a20]
D (379) BTDM_INIT: .bss initialise [0x3ffbdb28] - [0x3ffbdb5c]
I (379) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
D (389) phy_init: loading PHY init data from application binary
D (399) nvs: nvs_open_from_partition phy 0
D (399) nvs: nvs_get cal_version 4
D (409) nvs: nvs_get_str_or_blob cal_mac
D (409) nvs: nvs_get_str_or_blob cal_data
D (429) nvs: nvs_close 1
I (489) phy: phy_version: 4000, b6198fa, Sep 3 2018, 15:11:06, 0, 0
D (979) BT_APPL: Enable HCI
D (979) nvs: nvs_open_from_partition bt_config.conf 1
D (979) nvs: nvs_get_str_or_blob bt_cfg_key0
D (989) nvs: nvs_get_str_or_blob bt_cfg_key0
D (989) nvs: nvs_close 2
D (989) nvs: nvs_open_from_partition bt_config.conf 1
D (999) nvs: nvs_set_blob bt_cfg_key0 311
D (1009) nvs: nvs_close 3
D (1009) BT_APPL: BTA got event 0x100
D (1009) BT_APPL: bta_dm_sm_execute event:0x0
D (1009) BT_APPL: BTA got event 0x0
D (1019) BT_APPL: bta_sys_sm_execute state:0, event:0x0
D (1019) BT_APPL: bta_sys_hw_api_enable for 0, active modules 0x0001
D (1029) BT_APPL: BTA got event 0x1
D (1029) BT_APPL: bta_sys_sm_execute state:1, event:0x1
D (1039) BT_APPL: bta_sys_hw_evt_enabled for 0
D (1069) BT_APPL: bta_sys_hw_btm_cback was called with parameter: 0
D (1069) BT_APPL: BTA got event 0x2
D (1069) BT_APPL: bta_sys_sm_execute state:1, event:0x2
D (1079) BT_APPL: bta_sys_hw_evt_stack_enabled!notify the callers
D (1079) BT_APPL: bta_dm_sys_hw_cback with event: 1
D (1089) BT_APPL: bta_sys_free_timer expected alarm was not in bta alarm hash map.
D (1089) BT_APPL: bta_sys_free_timer expected alarm was not in bta alarm hash map.
D (1109) BT_APPL: BTA got event 0x105
D (1109) BT_APPL: bta_dm_sm_execute event:0x5
D (1109) BT_APPL: BTA got event 0x102
D (1109) BT_APPL: bta_dm_sm_execute event:0x2
D (1119) BT_APPL: BTA is generating EIR
D (1119) BT_APP_CORE: bt_app_work_dispatch event 0x0, param len 0
D (1129) BT_APP_CORE: bt_app_task_handler, sig 0x1, 0x0
D (1129) BT_AV: bt_av_hdl_stack_evt evt 0
I (1139) BT_AV: Starting device discovery...
I (1139) BT_AV: BT GAP is using Core : 0
D (1149) BT_APPL: BTA got event 0x102
D (1149) BT_APPL: bta_dm_sm_execute event:0x2
D (1159) BT_APPL: BTA is generating EIR
D (1159) BT_APPL: ## A2DP SOURCE START MEDIA THREAD ##
D (1169) BT_APPL: btc_a2dp_source_thread_init
D (1169) BT_APPL: ## A2DP SOURCE MEDIA THREAD STARTED ##
D (1179) BT_APPL: ## ON A2DP IDLE ## peer_sep = 0, service id = 3
D (1179) BT_APPL: bta_av_co_init
D (1189) BT_APPL: bta_av_co_cp_set_flag
D (1189) BT_APPL: bta_av_co_audio_codec_reset
D (1189) BT_APPL: BTA got event 0x122b
D (1199) BT_APPL: BTA got event 0x122c
D (1199) BT_APPL: Adding UUID=0x110C into EIR
D (1209) BT_APPL: BTA is generating EIR
D (1209) BT_APPL: bta_dm_eir_update_uuid UUID bit mask=0x00000000 00001000
D (1219) BT_APPL: nsc_mask: 0x6
D (1219) BT_APPL: bta_av_co_audio_init
D (1219) BT_APPL: bta_av_co_audio_init: 0
D (1229) BT_APPL: SEP Type = 0
D (1229) BT_APPL: audio[0] av_handle: 1 codec_type: 0
D (1239) BT_APPL: Adding UUID=0x110A into EIR
D (1239) BT_APPL: BTA is generating EIR
D (1249) BT_APPL: bta_dm_eir_update_uuid UUID bit mask=0x00000000 00001400
D (1249) BT_APPL: rc_acp_handle:0 idx:1
D (1259) BT_APPL: create 0, role: 1, shdl:0, rc_handle:0, lidx:3, status:0x10
D (1259) BT_APPL: Adding UUID=0x110E into EIR
D (1269) BT_APPL: BTA is generating EIR
D (1269) BT_APPL: bta_dm_eir_update_uuid UUID bit mask=0x00000000 00003400
D (1279) BT_APPL: reg_audio: 0x1
D (1279) BT_APPL: BTA got event 0x103
D (1289) BT_APPL: bta_dm_sm_execute event:0x3
D (1289) BT_APPL: BTA got event 0x200
D (1299) BT_APPL: bta_dm_search_sm_execute state:0, event:0x200
D (1299) BT_APPL: bta_dm_search_start avoid_scatter=1
D (1309) BT_APPL: bta_dm_check_av:0
D (1309) BT_APPL: bta_dm_search_start status=1
D (1319) BT_APPL: BTA got event 0x104
D (1319) BT_APPL: bta_dm_sm_execute event:0x4
I (1319) BT_AV: Discovery started.
D (1329) ledc: LEDC_PWM CHANNEL 1|GPIO 18|Duty 0100|Time 1
D (1329) ledc: LEDC_PWM CHANNEL 0|GPIO 23|Duty 0000|Time 0
D (2339) ledc: LEDC_PWM CHANNEL 0|GPIO 23|Duty 0000|Time 0
I (2539) BT_AV: Scanned device: 6c:56:97:0a:45:c9
I (2539) BT_AV: --Class of Device: 0x2c0414
I (2539) BT_AV: --RSSI: -82
E (3339) ledc: ledc_set_duty_with_hpoint(383): hpoint argument is invalid
D (3339) ledc: LEDC_PWM CHANNEL 0|GPIO 23|Duty 0000|Time 0
Determining frequency average on start up
Start calibration....pass #0
Startup Calibration Pulse Counter is on - Core: 0
First counter value for calibration:171
Second counter value for calibration:183
Count Difference: 12.000000
Start calibration....pass #1
Startup Calibration Pulse Counter is on - Core: 0
First counter value for calibration:183
Second counter value for calibration:195
Count Difference: 12.000000
Start calibration....pass #2
Startup Calibration Pulse Counter is on - Core: 0
First counter value for calibration:195
Second counter value for calibration:207
Count Difference: 12.000000
Start calibration....pass #3
Startup Calibration Pulse Counter is on - Core: 0
First counter value for calibration:207
Second counter value for calibration:219
Count Difference: 12.000000
Start calibration....pass #4
Startup Calibration Pulse Counter is on - Core: 0
First counter value for calibration:219
Second counter value for calibration:231
Count Difference: 12.000000
Start calibration....pass #5
Startup Calibration Pulse Counter is on - Core: 0
First counter value for calibration:232
Second counter value for calibration:244
Count Difference: 12.000000
Start calibration....pass #6
Startup Calibration Pulse Counter is on - Core: 0
First counter value for calibration:244
Second counter value for calibration:256
Count Difference: 12.000000
Start calibration....pass #7
Startup Calibration Pulse Counter is on - Core: 0
First counter value for calibration:256
Second counter value for calibration:268
Count Difference: 12.000000
Start calibration....pass #8
Startup Calibration Pulse Counter is on - Core: 0
First counter value for calibration:268
Second counter value for calibration:280
Count Difference: 12.000000
Start calibration....pass #9
Startup Calibration Pulse Counter is on - Core: 0
First counter value for calibration:280
Second counter value for calibration:292
Count Difference: 12.000000
SUM: 120
Average: 12
Analyzing frequency data to detect metal....
Running first counter value :293
Running second counter value :305
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :305
Running second counter value :317
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :317
Running second counter value :329
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :329
I (5469) BT_AV: Scanned device: 6c:56:97:0a:45:c9
I (5469) BT_AV: --Class of Device: 0x2c0414
I (5469) BT_AV: --RSSI: -81
Running second counter value :341
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :341
Running second counter value :353
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :353
Running second counter value :366
The frequnecy difference is :13
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :366
Running second counter value :378
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :378
Running second counter value :390
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :390
Running second counter value :402
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :402
Running second counter value :414
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :414
Running second counter value :427
The frequnecy difference is :13
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :427
Running second counter value :439
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :439
Running second counter value :451
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :451
I (6909) BT_AV: Scanned device: 6c:56:97:0a:45:c9
I (6909) BT_AV: --Class of Device: 0x2c0414
I (6909) BT_AV: --RSSI: -87
Running second counter value :463
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :463
I (7109) BT_AV: Scanned device: 6c:56:97:0a:45:c9
I (7109) BT_AV: --Class of Device: 0x2c0414
I (7109) BT_AV: --RSSI: -89
Running second counter value :475
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :475
Running second counter value :487
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :488
Running second counter value :500
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :500
Running second counter value :512
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :512
Running second counter value :524
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :524
I (7839) BT_AV: Scanned device: 6c:56:97:0a:45:c9
I (7839) BT_AV: --Class of Device: 0x2c0414
I (7839) BT_AV: --RSSI: -85
Running second counter value :536
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :536
Running second counter value :548
The frequnecy difference is :12
Frequency -------
...
...
...
Analyzing frequency data to detect metal....
Running first counter value :902
Running second counter value :914
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :914
Running second counter value :926
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :926
Running second counter value :939
The frequnecy difference is :13
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :939
I (12989) BT_AV: Scanned device: 6c:56:97:0a:45:c9
I (12989) BT_AV: --Class of Device: 0x2c0414
I (12989) BT_AV: --RSSI: -85
Running second counter value :951
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :951
Running second counter value :963
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :963
Running second counter value :975
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :975
Running second counter value :987
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :987
Running second counter value :999
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :1000
Running second counter value :1012
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :1012
Running second counter value :1024
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :1024
Running second counter value :1036
The frequnecy difference is :12
Frequency -------
Analyzing frequency data to detect metal....
Running first counter value :1036
D (14119) BT_APPL: bta_dm_inq_cmpl_cb
D (14119) BT_APPL: BTA got event 0x104
D (14119) BT_APPL: bta_dm_sm_execute event:0x4
D (14119) BT_APPL: BTA got event 0x203
D (14129) BT_APPL: bta_dm_search_sm_execute state:1, event:0x203
D (14129) BT_APPL: bta_dm_inq_cmpl
D (14129) BT_APPL: bta_dm_discover_device BDA:0x6C56970A45C9
D (14139) BT_APPL: bta_dm_discover_device name_discover_done = 0 p_btm_inq_info 0x3ffc28ec state = 1, transport=1
D (14149) BT_APPL: bta_dm_discover_device appl_knows_rem_name 1
D (14159) BT_APPL: BTA got event 0x207
D (14159) BT_APPL: bta_dm_search_sm_execute state:1, event:0x207
D (14169) BT_APPL: bta_dm_search_result searching:0x0000, result:0x0000
D (14169) BT_APPL: bta_dm_discover_next_device
D (14179) BT_APPL: BTA got event 0x206
D (14179) BT_APPL: bta_dm_search_sm_execute state:1, event:0x206
D (14189) BT_APPL: bta_dm_search_cmpl
I (14189) BT_AV: Device discovery failed, continue to discover...
I (14199) BT_AV: Device discovery failed, continue to discover...
D (14209) BT_APPL: BTA got event 0x200
D (14209) BT_APPL: bta_dm_search_sm_execute state:0, event:0x200
D (14219) BT_APPL: bta_dm_search_start avoid_scatter=1
D (14219) BT_APPL: bta_dm_check_av:0
D (14229) BT_APPL: bta_dm_search_start status=1
D (14229) BT_APPL: BTA got event 0x104
D (14229) BT_APPL: bta_dm_sm_execute event:0x4
D (14239) BT_APPL: BTA got event 0x200
D (14239) BT_APPL: bta_dm_search_sm_execute state:1, event:0x200
I (14249) BT_AV: Discovery started.
Running second counter value :1050
The frequnecy difference is :#14
Frequency +++++++
D (14259) ledc: LEDC_PWM CHANNEL 0|GPIO 23|Duty 0000|Time 0
Analyzing frequency data to detect metal....
Running first counter value :1059
Running second counter value :1071
The frequnecy difference is :12
Frequency -------
.
Steps to repropduce
// It helps if you attach a picture of your setup/wiring here.
Code to reproduce this issue
Here is a gist link to functions for detecting the change in frequency. Let me know if more code is needed.
https://gist.github.com/markingle/0524d0c946f9d30593aef598ea61b33f
Debug Logs
I have been able to create a SystemView DAT file. But I cannot tell that anything is wrong. I can post it if needed.
The text was updated successfully, but these errors were encountered: