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

Simulator fixes and support for using MacOS #334

Merged
merged 3 commits into from
Aug 7, 2023

Conversation

dgarske
Copy link
Contributor

@dgarske dgarske commented Aug 3, 2023

  • Added simulator support for Mac.
  • Fix for simulator to properly assemble wolfboot.bin + signedtestapp + update + swap.
  • Fixes for handling 64-bit assigned mmap virtual addresses. Added hal_flash_write and hal_flash_erase support for 64-bit using ARCH_64BIT and added haladdr_t for address type.
  • Fix simulator conflict with src/libwolfboot.o object in test-app.
  • Cleanup test-app linker flags.
  • Speedup the key tool builds.

@dgarske dgarske self-assigned this Aug 3, 2023
@dgarske dgarske force-pushed the sim_mac branch 2 times, most recently from 0bfe130 to 0aa41b8 Compare August 3, 2023 19:11
include/hal.h Outdated Show resolved Hide resolved
@dgarske dgarske force-pushed the sim_mac branch 3 times, most recently from cfe4e09 to 49f6608 Compare August 3, 2023 19:52
@dgarske dgarske requested a review from danielinux August 3, 2023 19:52
@dgarske dgarske force-pushed the sim_mac branch 2 times, most recently from 1b95d88 to 3b6817f Compare August 3, 2023 20:54
@dgarske dgarske force-pushed the sim_mac branch 4 times, most recently from 215bbcd to c3056c8 Compare August 3, 2023 22:17
@dgarske dgarske assigned dgarske and unassigned dgarske Aug 3, 2023
Copy link
Member

@danielinux danielinux left a comment

Choose a reason for hiding this comment

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

Simulator test gives segmentation fault on linux.

Reproduce with:
make test-sim-internal-flash-with-update

then
tools/scripts/sim-sunnyday-update.sh

I suspect two different strategies need to be used on Mac vs GNU due to the differences in mmap "hint pointer" handling.

* Added simulator support for Mac.
* Fix for simulator to properly assemble wolfboot.bin + signedtestapp + update + swap.
* Fixes for handling 64-bit assigned mmap virtual addresses. Added hal_flash_write and hal_flash_erase support for 64-bit address using uintptr_t. Enabled if platform is 64-bit and `FORCE_32BIT` is not defined
* Fix simulator conflict with src/libwolfboot.o object in test-app.
* Cleanup test-app linker flags.
@dgarske
Copy link
Contributor Author

dgarske commented Aug 7, 2023

Simulator test gives segmentation fault on linux.

Reproduce with: make test-sim-internal-flash-with-update

then tools/scripts/sim-sunnyday-update.sh

I suspect two different strategies need to be used on Mac vs GNU due to the differences in mmap "hint pointer" handling.

@danielinux I could not reproduce. What was your .config? I've only seen a seg fault if mmap returns a 64-bit pointer and parts of the code assume 32-bit when the address gets passed around.

…t explicit using `ARCH_64BIT` or known 64-bit architectures.
@danielinux
Copy link
Member

My bad, I was testing side-by-side, with the same config as master. I did not realize the address changed in the example config

@danielinux danielinux merged commit 727fc12 into wolfSSL:master Aug 7, 2023
42 checks passed
@dgarske dgarske deleted the sim_mac branch August 7, 2023 20:04
danielinux added a commit to danielinux/wolfBoot that referenced this pull request Aug 17, 2023
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.

2 participants