You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I once again spent days of debugging a problem a simple warning or an error could have avoided.
Description of the Problem
I had the following code in a function that should read data from an SPI device:
test ina, :pin_miso WZ
My problem was that I got no data from that device, I always received 0-Bytes.
I then connected an FPGA between the SPI Device and the Propeller to observe the communication and figured out, that the whole communication worked.
After flipping the operands I finally got the valid response in the Propeller:
test :pin_miso, ina WZ
Investigation of the Problems Origin
The documentation explicitly writes about the test command that it does not perform writing, so I was not concerned about the order of operands.:
Explanation
TEST is similar to AND except it doesn’t write a result to Value1; [..]
Anyway, in the description of the ina register, the following warning was spoken:
[..] Do not use INA as the destination operand; that only results in reading and modifying the shadow register whose address INA occupies. [..]
Suggestion as Solution
Obviously the assembler knows that this was an invalid use of the test instruction to access the ina register.
A warning like: "WARNING: Invalid use of ina register. ina should only be used as source register." would have helped a lot.
Environment
Version 1.00.81 Compiled on Jul 5 2019 09:30:36
The text was updated successfully, but these errors were encountered:
I agree, this is something we should improve. It should be a warning and will require a proper warning system to be implemented in the compiler first before implementing this (and other) warnings. It should not be an error because it actually does perform a task, though it is utilizing an odd behavior that is not typically utilized and certainly not what you intended.
I once again spent days of debugging a problem a simple warning or an error could have avoided.
Description of the Problem
I had the following code in a function that should read data from an SPI device:
My problem was that I got no data from that device, I always received 0-Bytes.
I then connected an FPGA between the SPI Device and the Propeller to observe the communication and figured out, that the whole communication worked.
After flipping the operands I finally got the valid response in the Propeller:
Investigation of the Problems Origin
The documentation explicitly writes about the
test
command that it does not perform writing, so I was not concerned about the order of operands.:Anyway, in the description of the
ina
register, the following warning was spoken:Suggestion as Solution
Obviously the assembler knows that this was an invalid use of the test instruction to access the ina register.
A warning like: "WARNING: Invalid use of ina register. ina should only be used as source register." would have helped a lot.
Environment
The text was updated successfully, but these errors were encountered: