Skip to content
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

Fix for @repo targets in mfg create #391

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dwld
Copy link
Contributor

@dwld dwld commented Apr 1, 2020

Without the fix, mfg create for targets such as
target.app: "@mcuboot/boot/mynewt" fails,
since the path to the .manifest, .hex and .bin is wrong.

This can be fixed by using the target app's FullName() instead of Name().

Without the fix, building targets such as
target.app: "@mcuboot/boot/mynewt" fails,
since the path to the .manifest, .hex and .bin is wrong.

This can be fixed by using the target app's FullName() instead of Name().

Signed-off-by: Stefan Diewald <[email protected]>
@utzig
Copy link
Member

utzig commented Apr 1, 2020

This use of Name() in those functions has been like this for basically ever. All my MCUBoot targets look something like the one you mentioned (target.app: "@mcuboot/boot/mynewt") and I see no build issues, what errors exactly am I expected to see? Please copy some newt -ldebug ... output here.

@dwld
Copy link
Contributor Author

dwld commented Apr 1, 2020

Hi @utzig, thanks for your feedback. I'll gather the debug output. Perhaps my .mfg file or my targets are not correct. I just published a documentation update idea, could you perhaps check it? #392
Thanks.

@dwld dwld changed the title Fix for @repo targets Fix for @repo targets in mfg create Apr 1, 2020
@dwld
Copy link
Contributor Author

dwld commented Apr 1, 2020

@utzig, here is the output of the current master newt build as it is:

$ newt -ldebug mfg create p_nrf52_ble 0.0.0.5
...
2020/04/01 16:30:41.371 [DEBUG] goroutine 1 [running]:
mynewt.apache.org/newt/util.NewNewtError(0xc0005a1760, 0xa3, 0xc00007f190)
        C:/<removed_for_privacy_reasons>/Github/mynewt-newt/util/util.go:77 +0xd3
mynewt.apache.org/newt/util.FmtNewtError(0x84555a, 0x2, 0xc00007f190, 0x1, 0x1, 0x0)
        C:/<removed_for_privacy_reasons>/Github/mynewt-newt/util/util.go:84 +0x72
mynewt.apache.org/newt/newt/mfg.newMfgBuildTarget(0xc000150840, 0x12, 0xc000150de0, 0x15, 0x0, 0x0, 0xc00067e210, 0x0, 0x0, 0x0, ...)
        C:/<removed_for_privacy_reasons>/Github/mynewt-newt/newt/mfg/build.go:226 +0x59e
mynewt.apache.org/newt/newt/mfg.newMfgBuilder(0xc0000c26e0, 0xc00043a120, 0x2, 0x2, 0x0, 0x0, 0x0, 0xc00059d170, 0x0, 0x0, ...)
        C:/<removed_for_privacy_reasons>/Github/mynewt-newt/newt/mfg/build.go:439 +0x255
mynewt.apache.org/newt/newt/mfg.LoadMfgEmitter(0xc0000c26e0, 0x500000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        C:/<removed_for_privacy_reasons>/Github/mynewt-newt/newt/mfg/misc.go:54 +0x15b
mynewt.apache.org/newt/newt/cli.mfgCreateRunCmd(0xc0000eec80, 0xc000108210, 0x2, 0x3)
        C:/<removed_for_privacy_reasons>/Github/mynewt-newt/newt/cli/mfg_cmds.go:117 +0x1ba
github.com/spf13/cobra.(*Command).execute(0xc0000eec80, 0xc0001080f0, 0x3, 0x3, 0xc0000eec80, 0xc0001080f0)
        C:/<removed_for_privacy_reasons>/go/pkg/mod/github.com/spf13/[email protected]/command.go:830 +0x2b1
github.com/spf13/cobra.(*Command).ExecuteC(0xc00008cf00, 0x845c6b, 0x4, 0x7)
        C:/<removed_for_privacy_reasons>/go/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x302
github.com/spf13/cobra.(*Command).Execute(...)
        C:/<removed_for_privacy_reasons>/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
main.main()
        C:/<removed_for_privacy_reasons>/Github/mynewt-newt/newt/newt.go:180 +0x19e

goroutine 6 [syscall]:
os/signal.signal_recv(0x0)
        C:/Anwendungen/Go/src/runtime/sigqueue.go:147 +0xa3
os/signal.loop()
        C:/Anwendungen/Go/src/os/signal/signal_unix.go:23 +0x29
created by os/signal.init.0
        C:/Anwendungen/Go/src/os/signal/signal_unix.go:29 +0x48

Error: failed to read manifest file: open C:/Entwicklung/newt_ble_central/bin/targets/nrf52_boot/app/boot/mynewt/manifest.json: The system cannot find the path specified.

With the fix, the command works for me and outputs the following paths as its inputs:

$ newt -ldebug mfg create p_nrf52_ble 0.0.0.5
...
Creating a manufacturing image from the following files:
    C:/Entwicklung/newt_ble_central/bin/targets/nrf52_ble/app/apps/<removed_for_privacy_reasons>/manifest.json
    C:/Entwicklung/newt_ble_central/bin/targets/nrf52_ble/app/apps/<removed_for_privacy_reasons>.elf
    C:/Entwicklung/newt_ble_central/bin/targets/nrf52_ble/app/apps/<removed_for_privacy_reasons>.img
    C:/Entwicklung/newt_ble_central/bin/targets/nrf52_boot/app/@mcuboot/boot/mynewt/manifest.json
    C:/Entwicklung/newt_ble_central/bin/targets/nrf52_boot/app/@mcuboot/boot/mynewt/mynewt.elf
    C:/Entwicklung/newt_ble_central/bin/targets/nrf52_boot/app/@mcuboot/boot/mynewt/mynewt.elf.bin

The nrf52_boot target.yml looks like this:

target.app: "@mcuboot/boot/mynewt"
target.bsp: "@apache-mynewt-core/hw/bsp/nordic_pca10056"
target.build_profile: optimized

The mfg.yml looks like this:

mfb.bsp: "@apache-mynewt-core/hw/bsp/nordic_pca10056"

mfg.targets:
    - nrf52_boot:
      name: "targets/nrf52_boot"
      offset: 0x0
      area: FLASH_AREA_BOOTLOADER
    - nrf52_ble:
      name: "targets/nrf52_ble"
      offset: 0x0
      area: FLASH_AREA_IMAGE_0
mfg.meta:
    area: FLASH_AREA_BOOTLOADER

@ccollins476ad
Copy link
Contributor

@dwld I wonder if this could be a Windows-specific issue you are seeing. Do you think you could show an example without redacting any paths? Unfortunately I don't have a Windows machine available to test this on.

@dwld
Copy link
Contributor Author

dwld commented May 11, 2020

@dwld I wonder if this could be a Windows-specific issue you are seeing. Do you think you could show an example without redacting any paths? Unfortunately I don't have a Windows machine available to test this on.

Sorry for the delay. I was on parental leave and will create new logs with full paths in the next days.

Copy link
Contributor

@sjanc sjanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this stil an issue? we use mcuboot for quite some time already and all seems to work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants