Commit Graph

627 Commits

Author SHA1 Message Date
Sam Kent 3413d5487d
Added Partial Flashing Service (#9)
* Memory Map + Partial Flash Service

* Moved Partial Flash Service to Management Mode

* PF Service appears in YT Build not PXT

* PF in PXT

* Swapped DFU and PF Services

* Fixing Flash Writew

* write flash via bluetooth

* Partial Flash -  Fixed Address

* Update module.json

* Adjust flash pointer

* Adjust flash start

* Adjust Flash Pointer

* Added offset to xfer

* Writing to FLASH_END

* Writing to FLASH_END

* Modified PFS read callback

* Reenable BLE Security

* removed pf

* Check diff

* Check diff

* Replaced ContextSwitch

* PF

* Test. Writing Hex File to 0x30000

* Writing to PXT empty space

* Reversed byte order

* Flash 16 bytes at once

* Copy data from static var to local var

* blocks -> bytes

* Fixed offset

* Fixed Offset

* Flash to 0x30000 + offset

* Bypass scratch page

* Changed byte order

* Write Without Response

* Without Fast BLE

* Added fast BLE

* Updated Connection Parameters

* Iterate through BLE data bytes

* Get Hashes From PXT Build

* Copy Hash from Flash

* Testing FLASH_END

* Read Hash From Flash

* Read Hash from Flash

* Reading correct hash from mem

* Endianess

* Modified MAGIC

* Fix Start Address

* Sequence #

* Write 0xdeadbeef to 0x36000 on PF Seq # error

* Group 4 packet blocks for writing

* Added error case

* Increased flash write size

* Blocks

* Fire event to write

* Decreased flash time

* Reformat

* Reduced hash size in MemoryMap

* Partial Flashing w/ Notifications

* One Characteristic - WRITE/WRITE_WOUT_RESP/NOTIFY

* Modified WRITE Notification

* Tidied - Moved end of transfer logic

* Removed VI Swap files

* Added Pairing Mode Event ID

* Modified Retransmit behaviour

* updateFlash caused stack overflow

* Removed flash write from memory map

* Instantiate Memory Map where used

* Word aligned. Added Status and Reset commands

* Fixed: storage. becomes storage->

* Fixed warnings: switch case fall through

* Fix Hash

* Rebuild Map everytime

* Hash Error

* Edited animation. Hash testing

* persistent memory map issues

* Moved EOT

* Modified BLE animation. Removed globals from PFS

* Updated MM

* Added incomplete flash flag

* Re added CCS.s
2018-04-16 17:27:14 +01:00
Joe Finney 2cff906f01
Merge pull request #325 from dpgeorge/image-remove-atoi
Rewrite MicroBitImage parsing code so it doesn't depend on atoi()
2017-12-19 15:13:07 +00:00
Joe Finney 6fa716f779
Merge pull request #326 from dpgeorge/heapallocator-remove-throw
Remove "throw" exception specifications because they are deprecated.
2017-12-19 15:05:23 +00:00
Joe Finney 0fe61146ec
Merge pull request #324 from microbit-sam/flash_write_bug
flash_write - Default scratch_address & Erase scratch when overwriting flash
2017-12-19 15:03:24 +00:00
Sam Kent ed65d39246 CortexContextSwitch.s disappeared 2017-11-16 09:40:43 +00:00
Sam Kent 1e7b0a76d3 Erase scratch page when overwriting 2017-11-16 09:33:34 +00:00
Damien George d883f33c5b Remove "throw" exception specifications because they are deprecated.
The use of such specifications are deprecated since C++11.
2017-11-16 11:04:40 +11:00
Damien George fbfee4930a Rewrite MicroBitImage parsing code so it doesn't depend on atoi()
Using the function atoi() pulls in a dependency from newlib, which in turn
pulls in locale support, and locale support requires about 350 bytes of
RAM.  This patch removes such a dependency by rewriting the MicroBitImage
parsing code so that it directly converts the input string to an integer
instead of building a buffer and passing it to atoi().

This patch saves about 640 bytes of code space and 364 bytes of RAM.  It
also reduces the amount of stack space used by the MicroBitImage
constructor.
2017-11-16 10:35:20 +11:00
Sam Kent 19a51d0f21 Neater if statement 2017-11-15 16:55:48 +00:00
Sam Kent edb8f16f1d CortexContextSwitch.s 2017-11-15 16:50:03 +00:00
Sam Kent f0ea4ad7e1 Added flash_write default scratchAddr 2017-11-15 16:48:23 +00:00
Joe Finney e0f8b005fe Merge pull request #312 from smartyw/master
Reduce default advertising interval and make property of config.json
2017-09-11 11:28:32 +01:00
Martin Woolley b7af033351 Simplified code wrt MICROBIT_BLE_ADVERTISING_INTERVAL since it's guaranteed to be defined 2017-08-31 10:59:17 +01:00
Martin Woolley dcb5398d36 Added MICROBIT_BLE_ADVERTISING_INTERVAL to MicroBitConfig.h 2017-08-31 09:04:12 +01:00
Martin Woolley d03ebf7056 Exposed Bluetooth advertising interval as config.json property and set default to 50ms 2017-08-16 12:13:13 +01:00
Martin Woolley 002272e048 Exposed Bluetooth advertising interval as config.json property 2017-08-16 12:05:32 +01:00
Joe Finney 7f70e588df Merge pull request #303 from smartyw/master
added support for Write Without Response to Client Event characteristic
2017-07-23 18:59:54 +01:00
Martin Woolley ce70039cb5 added support for Write Without Response to Client Event characteristic 2017-07-23 16:18:35 +01:00
Joe Finney f90ef0030d Merge pull request #296 from smartyw/master
BLE Magnetometer service has new characteristic for requesting calilbration
2017-07-18 11:14:13 +01:00
Martin Woolley 4c1950e007 commented out statements removed 2017-07-18 11:12:07 +01:00
Martin Woolley 5980f9015e Refactored to use only one event handler 2017-07-10 09:13:14 +01:00
Joe Finney 5746eb94a8 Merge pull request #299 from lancaster-university/IssuesResolving
Quick Clean up, added MIT Licence to some files and a spelling mistak…
2017-06-14 10:26:21 +01:00
alennie1993 aacba5f36e Quick Clean up, added MIT Licence to some files and a spelling mistake corrected. Issues #269 & #287 resolved. 2017-06-14 10:03:51 +01:00
Aidan Lennie e098364e5f Adding MIT Licence 2017-06-13 17:19:32 +01:00
Martin Woolley 66fd96b098 Added magnetometer calibration characteristic to the Bluetooth Magnetometer Service 2017-06-06 07:50:03 +01:00
Martin Woolley 621e328df1 Added new Magnetometer Calibration characteristic to Magnetometer Service 2017-05-30 10:17:08 +01:00
Joe Finney b84f89d27c Merge pull request #292 from lancaster-university/bugfix_289
Bugfix 289
2017-05-27 14:27:48 +01:00
Joe Finney e19594c73e Update comment for accuracy 2017-05-27 14:26:50 +01:00
Joe Finney 89294e4637 Merge pull request #293 from lancaster-university/bugfix-286
Erase scratch pages after use [#286]
2017-05-27 11:09:19 +01:00
Joe Finney 66d6fb3f81 Erase scratch pages after use [#286]
MicrobitFileSystem occasionally needs to "refresh" FLASH page that have been
marked as deleted, such that they can be used again. When this happens, an
unused FLASH page is used to temporarily hold wanted data (a scratch page).
This is alloctaed ina round robin fashion from all available data pages to
load balance wear across pages.

This patch ensures that a page used in this fashion is erased after use, such
that it is ready for use again as a data page.

This patch may also address https://github.com/Microsoft/pxt/issues/1495
2017-05-27 10:57:21 +01:00
Joe Finney c0995137f0 Cleanup internal method names
- Rename isInput() to isActiveInput() to improve readability
  - Remove isOutput() method
2017-05-25 23:41:37 +01:00
Joe Finney 2fe103f70b Fix MicroBitIOPinService 8bit AnalogInput bug #289
- Analog Input now correctly reads values in the 8 bit range.
- Analog Output now reaches 100% duty cycle for 8 but input value of 255.
- Reintroduce notify() call into updateBLEInputs() method.
- Minor code cleanups
2017-05-25 16:12:24 +01:00
Joe Finney 0aaedaa5d9 Remove repeated code in MicroBitIOPinService 2017-05-25 13:38:40 +01:00
Joe Finney ac5a750757 Remove redundant code in MicroBitIOPinService 2017-05-25 13:25:50 +01:00
James Devine d5ee7d99b6 microbit-dal: Corrected bad validation in MicroBitImage.printImage
width was validated, height was not. Documentation also modified to have a better example that works.
2017-04-23 00:53:16 +01:00
James Devine 58f8f0f22e microbit-dal: ManagedString heap error
Some higher level languages initialise Strings and Images used RefCounted types. In certain scenarios, they could be initialised with NULL, there was no error checking for this case, and users observed error code 030 (a heap error). This was traced back to some error checking in RefCounted.cpp, where the reference is tested. In these initialisers the RefCounted type was NULL.

Added some additional error checking in ManagedString and ManagedImage.

Closes #283.
2017-04-23 00:27:18 +01:00
Joe Finney 74fa06c8d0 Bump to microbit-dal v2.0.0-rc9 2017-04-21 16:20:53 +01:00
Joe Finney 20cfd2bc3b microbit: Ensure MicroBitFileSystem status flags are always initialized.
Addresses Issue https://github.com/Microsoft/pxt/issues/1682
2017-04-21 00:23:20 +01:00
James Devine a85d014382 Merge pull request #247 from sh1boot/squash
Quadrature decoder hardware driver.
2017-04-07 10:13:47 +01:00
Simon Hosie c1626c208c Remove sentinel pinNC from QDEC; use NULL instead. 2017-04-06 22:27:22 -07:00
Simon Hosie e2ec932480 Use better quadrature decoder flag names.
Name the quadrature QDEC_USE_xx rather than QDEC_USING_xx, because they
represent intent rather than status.

Also fixes bug where system tick wouldn't be registered at start() when
configured to do so.
2017-04-06 22:00:08 -07:00
Simon Hosie 3fd457c2b8 Quadrature decoder hardware driver. 2017-04-02 02:17:39 -07:00
Joe Finney 2f32db3e14 microbit: Ensure LED matrix display is cleared when brightness is set to '0' (#281)
- Fixed optimsation case for when brightness is set to zero in render() method.
- Introduce equivalent optimsation case for renderGreyscale(), to
  promote consistent behaviour.
2017-03-24 16:27:36 +00:00
Joe Finney fe3a3dd1f4 Update target version for mbed-classic and ble-nrf51822 2017-03-01 17:51:51 +00:00
Joe Finney 1f4893d1ff Bump Revision to microbit-dal-rc8 2017-03-01 17:44:44 +00:00
Joe Finney 9adafccbf6 Merge pull request #276 from lancaster-university/sd-safe-storage
Sd safe storage
2017-03-01 17:43:55 +00:00
Joe Finney 4b3520daa6 Update to MicrobitBLEManager to allow safe storage of BLE bond information 2017-03-01 17:41:28 +00:00
Joe Finney 564e7d700c Set default FS Cache size to zero.
- Workaround for minor bug noted that can cause data corruption. #275
2017-03-01 16:48:57 +00:00
Joe Finney c25ac4a79f Update to use NRF Event to detect end of FLASH write/erase transaction 2017-03-01 16:48:24 +00:00
Joe Finney 73d51d8731 Add Support for Flash Erase / Write operations with BLE Enabled
Nordic's Soft Device is not tolerant to applications making direct access to
the non-volatile memory controller (NVMC) hardware. This patch adds a code
path to replace native NVMC calls with equivalent Soft Device calls when Soft
Device is enabled.

This patch is necessary to resolve issues related to lock ups when using
either MicroBitStorage or MicroBitFileSystem when BLE is enabled.
2017-03-01 02:48:45 +00:00