pxt-microbit icon indicating copy to clipboard operation
pxt-microbit copied to clipboard

Bluetooth with music - error 070

Open aorczyk opened this issue 3 months ago • 5 comments

Describe the bug Using Bluetooth and music in the program produces error 070.

To Reproduce Steps to reproduce the behavior:

  1. Download the program below using the latest MakeCode version (makecode.microbit.org version: 8.0.16, Microsoft MakeCode version: 12.0.16, microbit runtime version: v2.2.0-rc6, codal-microbit-v2 runtime version: v0.3.2)
  2. Press the A button a few times.
  3. The error 070 appears.
music.setVolume(20)
bluetooth.startUartService()

let pressedA = false;
while (true) {
    basic.pause(20)

    if (input.buttonIsPressed(Button.A)) {
        if (!pressedA) {
            pressedA = true
            music.ringTone(Note.C)
        }
    } else {
        if (pressedA) {
            pressedA = false
            music.stopAllSounds()
        }
    }
}

Expected behavior No error.

Screenshots

micro:bit version (please complete the following information): V2 and V2.21

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: 141.0.7390.67

Smartphone (please complete the following information):

Additional context Works fine on MakeCode v7.1.47.

aorczyk avatar Oct 17 '25 17:10 aorczyk

@aorczyk Do you have to Bluetooth pair to see the error? Download a project without the Bluetooth extension to reset pairing.

This project is built with MakeCode v3 https://makecode.microbit.org/_35gY6y2y0hwU

The error doesn't seem to happen when it's built with MakeCode v3, v6, or v7 - only with v8.

@aorczyk Can you confirm it's OK with MakeCode v7?

This project fails too (forever instead of while) https://makecode.microbit.org/_PADW6xJLebUk

I'll make a C++ test.

v7: makecode.microbit.org version: 7.0.61 Microsoft MakeCode version: 11.1.14 codal-microbit-v2 runtime version: v0.2.68

v8: makecode.microbit.org version: 8.0.17 Microsoft MakeCode version: 12.0.16 codal-microbit-v2 runtime version: v0.3.2

martinwork avatar Oct 17 '25 19:10 martinwork

@martinwork

  1. No. The error appears even when Bluetooth is not paired (I mean not connected to a computer, only visible from it). When the option “No Pairing Required: Anyone can connect via Bluetooth.” is not enabled in the program settings, the micro:bit is not visible to the computer, and the program works.

  2. Yes. It’s fine with v7. I can connect the micro:bit via Bluetooth, music works, and the error does not appear.

aorczyk avatar Oct 18 '25 05:10 aorczyk

I have the same error using V8. Removing the music blocks resolved the 070 error. I tried downgrading the firmware without a benefit.

loretod avatar Oct 18 '25 09:10 loretod

Thanks @aorczyk "visible to the computer" makes sense. If it is "no pairing required" or paired, then it is advertising. That made it easier to test different versions! https://github.com/lancaster-university/codal-microbit-v2/blob/master/source/bluetooth/MicroBitBLEManager.cpp#L490

I have created a CODAL issue. https://github.com/lancaster-university/codal-microbit-v2/issues/506

martinwork avatar Oct 18 '25 15:10 martinwork

Reported in support ticket https://support.microbit.org/helpdesk/tickets/94150 (private)

martinwork avatar Dec 01 '25 16:12 martinwork