Beispiel #1
0
        public bool EraseFirmwareArea(enBoardType board)
        {
            switch (board)
            {
            case enBoardType.STM407VE:
            case enBoardType.STM407ZE:
                return((SupprotsErase && ErasePages(0, 1, 2, 3, 4, 5, 6)) || (SupprotsEraseEx && ErasePagesExt(0, 1, 2, 3, 4, 5, 6)));


            case enBoardType.STM407VG:
            case enBoardType.STM407ZG:
            case enBoardType.STM429IZ:
                return
                    ((SupprotsErase &&
                      ErasePages(0, 1) &&
                      ErasePages(2, 3) &&
                      ErasePages(4, 5) &&
                      ErasePages(6, 7) &&
                      ErasePages(8, 9) &&
                      ErasePages(10))
                     ||
                     (SupprotsEraseEx &&
                      ErasePagesExt(0, 1) &&
                      ErasePagesExt(2, 3) &&
                      ErasePagesExt(4, 5) &&
                      ErasePagesExt(6, 7) &&
                      ErasePagesExt(8, 9) &&
                      ErasePagesExt(10)));

            default:
                return(false);
            }
        }
Beispiel #2
0
 public bool EraseVariablesArea(enBoardType board)
 {
     if (board != enBoardType.STM429IZ)
     {
         return(false);
     }
     return((SupprotsErase && ErasePages(20, 21, 22, 23)) || (SupprotsEraseEx && ErasePagesExt(20, 21, 22, 23)));
 }
Beispiel #3
0
        public bool WriteMainProgram(enBoardType btype, byte[] data, bool eraseAll = true)
        {
            return

                (eraseAll
                    ? (
                     (SupprotsErase && EraseAll()) ||
                     (SupprotsEraseEx && EraseAllEx())
                     ) && Write(0x08000000U, data)
                    :
                 EraseFirmwareArea(btype) &&
                 Write(0x08000000U, data));
        }
Beispiel #4
0
        public bool WriteByteCode(enBoardType board, byte[] code, bool doClear)
        {
            switch (board)
            {
            case enBoardType.STM407VE:
            case enBoardType.STM407ZE:
                return((!doClear || (SupprotsErase && ErasePages(7)) || (SupprotsEraseEx && ErasePagesExt(7))) && Write(0x08060000U, code));


            case enBoardType.STM407VG:
            case enBoardType.STM407ZG:
                return((!doClear || (SupprotsErase && ErasePages(11)) || (SupprotsEraseEx && ErasePagesExt(11))) && Write(0x080E0000U, code));

            default:
                return(false);
            }
        }
Beispiel #5
0
        public bool EraseProgramArea(enBoardType board)
        {
            switch (board)
            {
            case enBoardType.STM407VE:
            case enBoardType.STM407ZE:
                return((SupprotsErase && ErasePages(7)) || (SupprotsEraseEx && ErasePagesExt(7)));


            case enBoardType.STM407VG:
            case enBoardType.STM407ZG:
            case enBoardType.STM429IZ:
                return((SupprotsErase && ErasePages(11)) || (SupprotsEraseEx && ErasePagesExt(11)));

            default:
                return(false);
            }
        }