Skip to content

QSPIF Quad SPI SFDP Block Device #1

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

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open

QSPIF Quad SPI SFDP Block Device #1

wants to merge 61 commits into from

Conversation

offirko
Copy link
Owner

@offirko offirko commented Jul 10, 2018

Description

Pull request type

[ ] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

0xc0170 and others added 30 commits June 29, 2018 09:15
Adding new QSPI HAL header file. This should help to use memory-maped devices
as memories, graphical displays.

The API consist of few functions, most important are read/write/write_command functions.

The command format is:

```
----------------------------------------------
| Instruction | Address | Alt | Dummy | Data |
----------------------------------------------
```

We define only synch API at the moment.
Fixing by adding NONE values for both
This provides a way to return how many bytes have been written/read (as status codes
are returned via func ret value)
SPI mode means Clock polarity and phase mode (0 - 3)
This commit adds QSPI HAL implementation for nrf52840 MCU targets
if address is skipped, used size NONE
Not used anymore, not defined. ctor default initializes the object
Should be: instr, alt, address or inst, addr or just addr
If phase is being skipped, set disabled to true, otherwise false.
0xc0170 and others added 22 commits June 29, 2018 09:15
Small corrections, fixing typos in the documentation
Disco IoT board support for QSPI. As it does not have dual flash support in QSPI,
we need to fix qspi hal implementation.
The ST HAL code is waiting for the correctly shifted vlue
(for a direct write into the HW register)
Adding QSPI_DATA_NONE activates the transfer
of the command inside HAL_QSPI_COMMAND function
It can change depending on the chosen command, not only at start.
This way we avoid to launch init function and break the internal status variables.
QSPI::configure_format shall not call initialize function.
This way, QSPI::configure_format can be called any time,
only to change the format of commands.
It must contain only parameters for the commands, not for the Init function
Add address unpacking support.
Only used in erase commands
offirko pushed a commit that referenced this pull request Aug 27, 2018
`handle_error` calls `MBED_CALLER_ADDR()`, but this is always a location from within platform/mbed_error.c. This is because `handle_error` is declared static. This does not cause the function to be inlined however. Instead, it is called by each function within mbed_error.c. For example, mbed_error yields this code:

```
000625c8 <mbed_error>:
   625c8:       b510            push    {r4, lr}
   625ca:       460c            mov     r4, r1
   625cc:       4611            mov     r1, r2
   625ce:       461a            mov     r2, r3
   625d0:       9b02            ldr     r3, [sp, ARMmbed#8]
   625d2:       f7ff feff       bl      623d4 <handle_error>
   625d6:       b968            cbnz    r0, 625f4 <mbed_error+0x2c>
   625d8:       4620            mov     r0, r4
   625da:       f7ff ff67       bl      624ac <print_error_report.constprop.0>
   625de:       f7ff fea8       bl      62332 <core_util_is_isr_active>
   625e2:       b910            cbnz    r0, 625ea <mbed_error+0x22>
   625e4:       f7ff fe9f       bl      62326 <core_util_are_interrupts_enabled>
   625e8:       b908            cbnz    r0, 625ee <mbed_error+0x26>
   625ea:       bf30            wfi
   625ec:       e7fd            b.n     625ea <mbed_error+0x22>
   625ee:       2001            movs    r0, #1
   625f0:       f000 f948       bl      62884 <__wrap_exit>
   625f4:       4800            ldr     r0, [pc, #0]    ; (625f8 <mbed_error+0x30>)
   625f6:       bd10            pop     {r4, pc}
   625f8:       80ff010f        .word   0x80ff010f
```

Note that at `625d2` there is a bl to handle error. That replaces the LR, which means that ALL calls to mbed_error will report a location of 0x625d6 or 0x625d7 (user vs. supervisor). I do not expect that this was the intention of the code. The simplest fix is to change line 99:

```C
static inline mbed_error_status_t handle_error(mbed_error_status_t error_status, unsigned int error_value, const char *filename, int line_number)
```

Since `handle_error()` will be inlined, the link register will be kept the same, so `MBED_CALLER_ADDR()` will yield the expected result. However, there is no guarantee that the compiler will respect the `inline` keyword in all circumstances.

The result is that each function that wishes to report its caller must extract its caller. This code cannot be centralised.

I have modified `mbed_error.c` to report the caller of each error reporting function, rather than the error reporting function itself.
offirko pushed a commit that referenced this pull request Sep 2, 2018
Added more warnings about FlashIAP
offirko pushed a commit that referenced this pull request Sep 2, 2018
offirko pushed a commit that referenced this pull request Oct 9, 2018
NFC: Amend ndef parsing design.
offirko pushed a commit that referenced this pull request Oct 15, 2018
choose which lpc1768 timer to use for us_ticker.c
davidsaada pushed a commit that referenced this pull request Nov 19, 2018
offirko pushed a commit that referenced this pull request Dec 11, 2018
offirko pushed a commit that referenced this pull request Mar 20, 2019
Finish memory protection and add static assert
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.

5 participants